Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable F1 key

Status
Not open for further replies.

johnv20

Programmer
Sep 26, 2001
292
US
Hi,
I am using a scanner to read in a barcode, however the scanner is sending F1 after reading the barcode string which brings up the help screen on IE - does anyone know how to stop this from happening - in Javascript ?
 
I'm not sure you can prevent the F1 tag from being read by the browser, however if it is possible than you could do the following:
1) Set the document.onkeyup = yourFunction;
2) In your function determine if the e.keycode is equivalent to the f1 keycode
3) if so, return false, else return true
4) in order to determine the keycode for f1, write the values of key strokes to a text input in the above script as a test so that you can see what code comes up for F1

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top