bsxiong Posted August 12, 2007 Share Posted August 12, 2007 is there a way to disable particular keys on the keyboard, such as every keys expect the a-z, 0-9, enter, backsapce , shift? The only thing that i'm taking another rout is that if they press on other buttons such as f1-f12 or tab, caplocks, crtl, then a msgbox pops up. Oh, and can you disable the start menu key on the keyboard too? Link to comment Share on other sites More sharing options...
Bert Posted August 12, 2007 Share Posted August 12, 2007 you could use hotkeyset and make it do nothing. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Generator Posted August 12, 2007 Share Posted August 12, 2007 Base on what Volly said... HotkeySet("{F11}","_Nothing") ;F11 as example Func _Nothing() EndFunc Link to comment Share on other sites More sharing options...
chenxu Posted August 12, 2007 Share Posted August 12, 2007 Base on what Volly said... HotkeySet("{F11}","_Nothing") ;F11 as example Func _Nothing() EndFuncThis is good method to block some specified key you need, but if need to block all keys, try this: BlockInput -------------------------------------------------------------------------------- Disable/enable the mouse and keyboard. BlockInput ( flag ) Parameters flag 1 = Disable user input 0 = Enable user input Return Value None. Remarks If BlockInput is enabled, the Alt keypress cannot be sent! The table below shows how BlockInput behavior depends on the Windows version; however, pressing Ctrl+Alt+Del on any platform will re-enable input due to a Windows API feature. Link to comment Share on other sites More sharing options...
ChrisL Posted August 12, 2007 Share Posted August 12, 2007 (edited) is there a way to disable particular keys on the keyboard, such as every keys expect the a-z, 0-9, enter, backsapce , shift? The only thing that i'm taking another rout is that if they press on other buttons such as f1-f12 or tab, caplocks, crtl, then a msgbox pops up. Oh, and can you disable the start menu key on the keyboard too? This should get you started. Run it uncompiled in Scite to get the output. There are some keys you can not set as hotkeys there are also some you'll need to add in manually to what I have created below. Start menu key can't be blocked without an external dll, however you can trap the key with if _isPressed() and resend the Windows key up to close the start menu expandcollapse popup$hotkeysBlocked = "" HotKeySet ("^!a","Quit") For $i = 33 to 47 Hotkeyset(Chr($i),"_Nothing") $hotkeysBlocked &=Chr($i) Next For $i = 58 to 64 Hotkeyset(Chr($i),"_Nothing") $hotkeysBlocked &=Chr($i) Next For $i = 91 to 96 Hotkeyset(Chr($i),"_Nothing") $hotkeysBlocked &=Chr($i) Next For $i = 123 to 127 Hotkeyset(Chr($i),"_Nothing") $hotkeysBlocked &=Chr($i) Next Msgbox(0,"",$hotkeysBlocked & " Blocked" & @crlf & "Click OK then try typing and see which charaters you can type blocked ones will be written to the Scite console" & @crlf & "'Use CTRL + ALT + a' to exit" & @crlf) While 1 sleep(100) WEnd Func _Nothing() ConsoleWrite ("Blocked " & @HotKeyPressed & @crlf) EndFunc Func Quit() Exit EndFunc IS pressed stuff #include <Misc.au3> if _IsPressed("5B") OR _IsPressed("5c") Then send("{LWIN UP}{RWIN UP}{ESC}") Edited August 12, 2007 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
bsxiong Posted August 13, 2007 Author Share Posted August 13, 2007 thanks yall! 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