473,326 Members | 2,111 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,326 software developers and data experts.

hotkeys

Hi,

I would like to add hotkeys to my webapp -
it's running on a barcode scanner, that has got
a number pad and the keys F1 - F4.
I would like to add hotkeys, so that
when the user presses F1, the focus is
set on form field 1 and so on...

Is that possible with javascript, if so, how?

Thx,

Bernd
Jun 9 '06 #1
3 3726
Bernd Eichelsdorf wrote:
Hi,

I would like to add hotkeys to my webapp -

Is that possible with javascript, if so, how?


Yes, it is possible.
Take a look at
http://www.w3.org/2002/09/tests/keys.html

And you also may need to prevent the default action in an event handler

if (event.preventDefault)
event.preventDefault();
else
event.returnValue = false; // IE
Jun 9 '06 #2
Robert schrieb:
Bernd Eichelsdorf wrote:
Hi,

I would like to add hotkeys to my webapp -

Is that possible with javascript, if so, how?


Yes, it is possible.
Take a look at
http://www.w3.org/2002/09/tests/keys.html

And you also may need to prevent the default action in an event handler

if (event.preventDefault)
event.preventDefault();
else
event.returnValue = false; // IE

Sorry, I don't understand.
When I press F1, it tells me:
Data keydown keypress keyup
keyCode 67 0 ---

but how can I do this myself, that
I know if the user has pressed F1?
Jun 11 '06 #3
Bernd Eichelsdorf said the following on 6/11/2006 2:28 AM:
Robert schrieb:
> Bernd Eichelsdorf wrote:
>> Hi,
>>
>> I would like to add hotkeys to my webapp -
>>
>> Is that possible with javascript, if so, how?

>
> Yes, it is possible.
> Take a look at
> http://www.w3.org/2002/09/tests/keys.html
>
> And you also may need to prevent the default action in an event handler
>
> if (event.preventDefault)
> event.preventDefault();
> else
> event.returnValue = false; // IE

Sorry, I don't understand.
When I press F1, it tells me:
Data keydown keypress keyup
keyCode 67 0 ---
but how can I do this myself, that
I know if the user has pressed F1?

You check the keycode that triggered it and see if it is 67. If it is,
then you know they pressed F1.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 11 '06 #4

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

Similar topics

0
by: skumar | last post by:
I need to access the Tabpages by hotkeys "alt+P" in case of "Principals" as one of the Tabpage. Also i need to underline the word "P" in "Principals" so that user is informed about the hotkey.If...
2
by: Hasan Ammar | last post by:
Is it possible to set up hotkeys using onkeypress? I know it can be done with the usual alphanumeric keys, but what about function keys? or using ctrl/alt combinations? Does anybody have a...
1
by: Matthew Wells | last post by:
How do you prevent someone from using Ctrl+, (ctl + comma) or Ctl + . (Ctl + perios) to get to design view. I have all the normal properites turned off (Access special keys, F!!, etc) but nothing...
3
by: Matthew Wells | last post by:
I'm reposting because an idiot replied without reading the whole message. I've tried autokeys and it isn't working for this combination. Please read on. While in form view, how do you prevent...
2
by: Jason Duncan | last post by:
I have a C# WinForm application (.net 1.0). On my Menu and Buttons I use the '&' (in the .Text properties) for Hotkey access. No biggie. The strange behavior is that the '&' is converted to the...
2
by: Martin Hjärtmyr | last post by:
I have a program that uses Hotkeys! And they works just fine! I use this hotkeylib:...
2
by: =?Utf-8?B?SXZvODY=?= | last post by:
Hi, I need ot set hotkeys to my windows application. I want when Word is thea active application and when user press "Ctrl+Alt+T" for example to start my action. I used RegisterHotKey and...
0
by: Octavius Khan | last post by:
How can I set system hotkey that will only work for specific applications. For example, I have a system tray application that uses hotkeys to perform certain tasks like placing text into a memo...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.