473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how disable F1 key

I need write simple program with work in background

and have only one function when it is run F1 I disable

and when I pres for example ctrl+k it (program is terminate)

maybe somebody have similar program or part of code I don't know

how get signal F1 pressing and neutralize it?
Nov 14 '05 #1
2 5733
In article <cu**********@inews.gazeta.pl>, Dw70 <dw**@gazeta.pl> wrote:
:I need write simple program with work in background
:and have only one function when it is run F1 I disable
:and when I pres for example ctrl+k it (program is terminate)
:maybe somebody have similar program or part of code I don't know
:how get signal F1 pressing and neutralize it?

Anything like that would have to be quite dependant upon the
operating system involved -- C has no knowledge of what an F1 key
is [and neither does any POSIX or ISO standard that I am awae of.]

You did not specify the operating system, and it would be time-
consuming for us to list all the different ways that F1 might
be disabled on the operating system environments we know of.

My suspicion is that you mean to use this on one of the
Microsoft Windows environments. If so, then I suggest you examine
Microsoft documentation and Microsoft-specific newsgroups to find out
more about the technology involved. I have no idea how it's done
in current MS Windows environments; the technology that used to
be used was the 'TSR' ("Terminate and Stay Resident").

If you were programming for X Windows, such as for a Unix-based
graphics environment, then the general mechanism would be to push a new
transparent window onto the top of the window stack, with the window
set to receive keyboard events; you would probably want in such a case
to set it up to recognize by scan code rather than by key. You would
check the event handed to you, and if it was not one of the events you
are interested in, you would return a status code indicating that it
was okay to pass the event on to the next layer; for the events you
were interested in, you would "consume" the event. Recognizing by
scan-codes is tricky because it is less portable in the case of
different keyboards, but if you recognize by the full key then the X
key binding mechanism may already have mapped the F1 to something else,
if the user has an active 'modmap' [which is usually the case.] Of
course one of the difficulties with modmaps is that the user can map a
different key to perform whatever function of F1 it is that you are
trying to disable...

This problem, the possibility of modmaps, is not confined to
X: in Windows, it is fairly common for Microsoft and Logitech and
others to provide software that allows the keyboard or mouse to
be customized, so that keys perform different functions [e.g.,
if you wanted a Dvorak keyboard, or wanted to change the function
of the middle mouse button.] You have to ask yourself whether you
really want to just disable the F1 key, or if it is some function
invoked by pressing the key that you want to disable, seeing as
other keys might be programmed to produce that function. You should
also be asking yourself whether you want to disable F1 -totally-,
or if you just need it disabled when a certain program has "focus"
(the program that is being affected by the mouse and keyboard.)

--
WW{Backus,Church,Dijkstra,Knuth,Hollerith,Turing,v onNeumann}D ?
Nov 14 '05 #2
On Sat, 12 Feb 2005 21:49:58 +0100, in comp.lang.c , "Dw70"
<dw**@gazeta.pl> wrote:

how get signal F1 pressing and neutralize it?


interacting with funny keys is a FAQ - 19.5
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bob Bedford | last post by:
I create checkboxes using datas from a database (with PHP). I store all values in an array, as I must pass this value like a Form value. Now, in some cases, when a checkbox is selected, I must...
6
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled...
12
by: Forti2ude | last post by:
Hello, I have a simple form... <form> <select name="foo" multiple> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select>
13
by: Rich | last post by:
Hello, So I would like to disable a textbox on a vb.net form without the text getting grayed out. In vb6 I could place a textbox control on a frame control and disable the frame leaving the...
4
by: Chris | last post by:
I have an asp.net page say page1.aspx. The form in html code is <form id = "Form1"> And i want to disable all the fields of the form after some code steps. I had created a javascript funct: ...
0
by: Ahmad Jalil Qarshi | last post by:
Hi! I have a problem while developing some webpages.The Problem is that:- How We Can Disable The Controls Of One Web Form From Other Web Form In Asp.net? Explanation:- There Should Be Two...
8
by: prado | last post by:
I want to disable a table with javascript. In this table i have 'n' record and each record has 3 buttons. If you click a button does an action. I want to disable the all table. is there any way...
4
by: Phoe6 | last post by:
Hi all, I am trying to disable the NIC card (and other cards) enabled in my machine to test diagnostics on that card. I am trying to disable it programmatic using python. I checked python wmi and...
0
by: sainiranji | last post by:
Hi All I have diffrent categories in diffrrent logging purpose and all are working fine...but now my requirment is to disable all at once . The below are change i did for disable all logges...
8
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? -----------------------------------------------------------------------...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.