Just1f Posted February 10, 2008 Share Posted February 10, 2008 (edited) Hello, I am working on an administrative tool for an online game. In this game there is a dialog box that can be open using the ENTER key. Nothing can be edited in this box excepted the prompt Dialog box picture: /-----------\ |... . ... .. .| | ..... . . . .| <- game messages |_______| |_______| <-- prompt I want users to be able to answers my questions using the prompt in the dialog box. So I send a text on the prompt of the dialogbox (eg.: a question) and waits for them to answer. I want to filter each key press so users can type some letters ("yn", or ASCII only, etc.) but cannot press DEL, SPACE, moove the mouse, etc. I also need it to detect ENTER. Is that possible to read keypresses despite BlockInput() or to read each key and/or mouse event in a loop and forward them to the application only once filtered ? Edited February 10, 2008 by Just1f Link to comment Share on other sites More sharing options...
Swift Posted February 10, 2008 Share Posted February 10, 2008 _IsPressed() Hotkeyset("{ENTER}", "") which will take over enter...and not let it do anything Link to comment Share on other sites More sharing options...
Just1f Posted February 10, 2008 Author Share Posted February 10, 2008 _IsPressed()Hotkeyset("{ENTER}", "") which will take over enter...and not let it do anything Thank you for that quick answer.Do you know where _IsPressed() and affiliated are documented ? Link to comment Share on other sites More sharing options...
Swift Posted February 10, 2008 Share Posted February 10, 2008 In The HelpFile Well..It Should Be At Least...Lemme Check Check if key has been pressed #Include <Misc.au3> _IsPressed($sHexKey[, $vDLL = 'user32.dll']) Parameters $sHexKey Key to check for $vDLL Handle to dll or default to user32.dll Return Value True: 1 False: 0 Remarks If calling this function repeatidly, should open 'user32.dll' and pass in handle. Make sure to close at end of script Related Example #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("23", $dll) Then MsgBox(0,"_IsPressed", "End Key Pressed") ExitLoop EndIf WEnd DllClose($dll) Link to comment Share on other sites More sharing options...
Just1f Posted February 10, 2008 Author Share Posted February 10, 2008 (edited) In The HelpFile Well..It Should Be At Least...Lemme CheckOkay so _IsPressed() will tell me if a key has been pressed, but how will I block other keys entries? Do I have to set each key of the keyboard as hotkey ?? Is there a way to customize BlockInput()'s range ? Edited February 10, 2008 by Just1f 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