dotnetter Posted December 18, 2012 Posted December 18, 2012 Hello,From AutoIt documentation: When you set a hotkey, AutoIt captures the key-press and does not pass it on to the active applicationNot in my case... When focus is set on some button, pressing space is spawning my function, but also click on the button is performed. Is there any way to avoid that click?Thanks in advance. The most important is to treat what's most important with utmost importance
Exit Posted December 18, 2012 Posted December 18, 2012 please show your code. App: Au3toCmd UDF: _SingleScript()
dotnetter Posted December 18, 2012 Author Posted December 18, 2012 (edited) Nothing fancy: HotKeySet("{Space}", "dontClickThatButton") Func dontClickThatButton() MsgBox(0, "Oh no!", "Ups I did it again..." EndFunc Edited December 18, 2012 by dotnetter The most important is to treat what's most important with utmost importance
Exit Posted December 18, 2012 Posted December 18, 2012 (edited) This can't be your code since it has a syntax error. Edited December 18, 2012 by Exit dotnetter 1 App: Au3toCmd UDF: _SingleScript()
Bert Posted December 18, 2012 Posted December 18, 2012 Nothing fancy: HotKeySet("{Space}", "dontClickThatButton") Func dontClickThatButton() MsgBox(0, "Oh no!", "Ups I did it again..."[color=#ff0000])[/color] EndFunc The correction in the example you gave (adding a ")") makes your code work as designed. You hit the space bar and a msgbox appears. Could you show us your entire code? dotnetter 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/
JohnOne Posted December 18, 2012 Posted December 18, 2012 Does not send the space for me. dotnetter 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
dotnetter Posted December 19, 2012 Author Posted December 19, 2012 Hello again,You both are right! There was copy/paste error in my code and the code doesn't send the space. I created example more alike my real code which is to long to paste here:HotKeySet("{Space}", "dontClickThatButton") While 1 Sleep(10) WEnd Func dontClickThatButton() ConsoleWrite("Ups I did it again..." & @CRLF) EndFunc1. When focus was set on button in another application and code in my previous post generated MsgBox space WAS "consumed" and everything was fine (sorry for not testing that example thoroughly)2. The code pasted above passes the space (presses the focused button in another application) indeed, but after more testing I found that it concerns only my particular case - java applet window (in windows applications space was NOT passed)The workaround: In first line of my function (dontClickThatButton()) I'm changing focus in the java applet window to some not clickable element and everything works fine.That closes the case, I suppose.Thank you for your cooperation The most important is to treat what's most important with utmost importance
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