keboard commands
-
I need to be able to open my web site using a keyboard command. Does anyone have any idea how to code that? :confused:
-
I need to be able to open my web site using a keyboard command. Does anyone have any idea how to code that? :confused:
Hey... what I can help you with is a little Javascript that executes a specific comandad after a certain string of letters or keys are pressed in the correct order on your keyboard. Place this in the of your file(s) and substitute "word" in the SpecialWord variable for any string of characters that you wish to use. The SpecialUrl can be any page where you would like to be redirected after typing your secret word. SO here it goes..
var SpecialWord = "word",SpecialUrl = "http://www.yoursite.com/secrete_server/",SpecialLetter = 0; function getKey(keyStroke) { var isNetscape=(document.layers); // Cross-browser key capture routine couresty var eventChooser = (isNetscape) ? keyStroke.which : event.keyCode; var which = String.fromCharCode(eventChooser).toLowerCase(); if (which == SpecialWord.charAt(SpecialLetter)) { SpecialLetter++; if (SpecialLetter == SpecialWord.length) window.location = SpecialUrl; } else SpecialLetter = 0; } document.onkeypress = getKey;
with a small modification you could execute a specific JScript, VBScript..or pretty much anything else.. hope that works... luck.. Jon X-ZD Designs