hotkeys

  • Thread starter Bernd Eichelsdorf
  • Start date
B

Bernd Eichelsdorf

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
 
B

Bernd Eichelsdorf

Robert said:
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?
 
R

Randy Webb

Bernd Eichelsdorf said the following on 6/11/2006 2:28 AM:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top