September 6, 200421 yr Hi,I am working on a Project in which the User should not Switch on to any toher application other than mine. I want to disable certain keys like Windows Key and Alt-Tab Combination key. How would I make it Possible.The Code can be in Java or Java Script.
September 17, 200421 yr good luck with that one...just a question??? why would you possibly want to do that?-neo(I am pretty sure it is not possible)
September 22, 200421 yr I do know that its possible...But just see that the site it results in doesn't start to annoy normal usage. Because, I remember a site which did this:Has a field where you enter case number (its a legal services site). If you used the "Back" arrow key to correct it, it immediately popped up a dialog-box - Please enter a number between -blah-blah-blah- And it did this every-time I pressed an arrow-key or a back-space. I HAD to use the mouse to get the cursor to where I wanted. That really was one annoying experience.
September 22, 200421 yr Uh, that isn't the same thing at all, that's just normal form validation (comparing keystrokes with a allowed keystrokes and with a mask) - gone bad (bad implementation). It's an event of the textbox or whatever that had the focus, and no, they don't have events fot alt-tab. There are ways to prevent a user from switching tasks - but not this way (I don't know your setup - nor why/how you want to do this)
October 14, 200421 yr Author Well Friends,let me tell you why I want to do this, Just open any Form and Press ALT-TAB Keys Simultaneously. You will Come to One More Window Right All that I need is I dont want user to Pass from MY WINDOW to other window unless he closes it, I know it is Possible and also Done in many Sites.
December 4, 200421 yr ALT+TAB is something inherent to the Windows Operating System and is completely out of reach for JavaScript or any other scripting language (and even any programming language as far as I remember).there is a way however to return a message to the user when he presses a key when you don't want him to do that <script text="textjavascript"> function detect() { var pressKey = String.fromCharCode(event.keyCode); if (event.altKey) { alert('hello realguru'); }}; </script><body onkeydown="detect()"> Just detect the onKeyDown event and look for the keycode (event.keycode) or (event.altKey) and either process a return value of false .. or remap the key to some other key.This is just a scribble, and wouldnt work in NN, or maybe even mozilla firefox because those browsers require a convoluted script to trap and process the onkeydown event.too tired now to even explain thatI can't think of one good reason for disabling that key
Create an account or sign in to comment