realguru Posted September 6, 2004 Share Posted September 6, 2004 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. Link to comment Share on other sites More sharing options...
neouser99 Posted September 17, 2004 Share Posted September 17, 2004 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) Link to comment Share on other sites More sharing options...
prathapml Posted September 22, 2004 Share Posted September 22, 2004 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. Link to comment Share on other sites More sharing options...
CoffeeFiend Posted September 22, 2004 Share Posted September 22, 2004 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) Link to comment Share on other sites More sharing options...
realguru Posted October 14, 2004 Author Share Posted October 14, 2004 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. Link to comment Share on other sites More sharing options...
phyxsius Posted December 4, 2004 Share Posted December 4, 2004 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now