473,785 Members | 2,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to capture function key presses

guys,

i want to capture all the function key presses from F1 to F12. now i
want that when the user presses F1 from within the browser i should
display a alert window saying that they have pressed F1 instead of
displaying the browser help.

how can i implement this. thanks.

Oct 31 '06 #1
2 5710
pe******@gmail. com ha scritto:
i want to capture all the function key presses from F1 to F12. now i
want that when the user presses F1 from within the browser i should
display a alert window saying that they have pressed F1 instead of
displaying the browser help.
You can do this in IE only with a .hta file (groups.google. com). For F1
key you can use:

window.onhelp=f unction()
{
alert("help");
return false;
}

Regards.

--
Luke S.

--

questo articolo e` stato inviato via web dal servizio gratuito
http://www.newsland.it/news segnala gli abusi ad ab***@newsland. it
Nov 1 '06 #2
ASM
pe******@gmail. com a écrit :
i want to capture all the function key presses from F1 to F12. now i
want that when the user presses F1 from within the browser i should
display a alert window saying that they have pressed F1 instead of
displaying the browser help.
In which browser ?
On Windows, Mac, Linux ... ?

i.e : my Opera thinks I press F4 when Ctrl+4 are pressed :-(
i.e : on my Mac F9 to F16 are reserved for system
doubt you can catch them ?
i.e : on my Browser F1 is not for the Help
(not important it does nothing)
how can i implement this. thanks.
Implement what and why ? and for who ?

In my FF on my Mac =
F1 -keyCode = 112
F2 -keyCode = 113
....
F12 _keyCode = 123

http://perso.wanadoo.fr/stephane.mor...c/key_code.htm

--
ASM
Nov 1 '06 #3

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

Similar topics

3
13532
by: Me Mine | last post by:
i, I have trying to code a small console app that will allow a user to select a window and then create a screen capture of the window. I haven't been able to figure out how to do the screen capture part. The code is as follows, the commented out lines at the end are things I have tried, but don't work. Whenever I try to create a compatibe Bitmap or DC it comes back with an error as win32ui: CreateCompatibleDC failed
2
5930
by: aimee | last post by:
Hi. Is there a way to capture the events fired in a PrintDialog? I would like to capture when the user presses "Print" so I can do some cleanup. The asp.net (IE6) application I'm working on has 6 pages, each of which has a link to a "print view" page. That "print view" page has a "print" button which calls a javascript function "printThis": function printThis() { alert('printThis')
2
11322
by: orekinbck | last post by:
Hi There In a C# windows app in .NET 2003, I would like to capture when the user is within a certain text box and holds down shift then presses tab. Atm, my code is: protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { const int WM_KEYDOWN = 0x100;
2
7055
by: Don | last post by:
It took me a while to find this code, so I decided to post it here for others who might also be looking for a way to trap tab key presses. You can extend a control and place this code in it to raise a custom TabKeyDown event. Here is an example of how you might extend a TextBox control to provide this event: Public Class TextBoxEx Inherits TextBox
0
3503
by: j101 | last post by:
I am attempting to set up Q Capture on RH Linux (x86_64) using DB2 9 fp2, but there seems to be a general problem loading a specify MQ shared library "/opt/mqm/lib/libmqm_r.so". I have MQ v6 installed in the default directory and working. I can generate the similar errors in two ways (1) through the Replication Center attempting to validate the Q objects and (2) after manually creating the Q objects and running the asnqcap program. ...
6
2367
by: trbjr | last post by:
Hello experts, I want to describe a project design and then ask some questions at the end. There is no code in this discussion, just symbols to illustrate an idea. Let S stand for a screen or form. I want to capture data as answers to questions presented to a user thru a series of screens. Since there are many user questions, I will ask them thru a series of screens. Thus, let S1, S2, S3, ... Sn
1
3846
xarzu
by: xarzu | last post by:
How do I capture the event in a CEdit control when the user presses enter or return in a dialog box? I have so far figured out how to disable the event when the user hits return which normally would close the dialog box (there are several ways to do this). This was only half of the problem. Now I am trying to capture the event inside the edit box.
5
14851
by: sourav08 | last post by:
Hello, I'm developing a website using PHP, Javascript and MySQL. I have a login form with a couple of textboxes and a login button. What I want to do is capture the Enter key so that when the user presses Enter, it will behave like tab and throw the onchange event (written for each field). I have searched the Internet for hours now trying to find out how to do it, but any methods that I have seen do not work.
4
2317
by: Vighneswar | last post by:
Hi All Can anybody please suggest me in this regard that I need to capture the keystrokes on all the word processors (Ms Word, Excel .. Etc), text editors (Notepad .. Etc) and suggest nearer words to the keystrokes. I have the DB for suggesting the nearer words but wasn't sure on how to capture the keystrokes on all the word processors, text editors. Please advise. Thanking you in advance.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9954
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8979
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.