Hello all,
This is my first script with AutoIT and I'm trying to do something EXTREMELY simple. I'm using the HotKey UDF Library http://www.autoitscript.com/forum/topic/90492-hotkey-udf/
I need to use this over HotKeySet because HotKeySet seems to be blocked in nearly every application I've tried it in, minus just default windows programs.
Here is my script:
I'm trying a simple example where if I press F12, it presses the Q key instead. Problem is it just does NOT seem to work when I use Send(). If I uncomment the MsgBox function, that will activate if I press F12, but when I try to assign it to send a separate key, it just flat doesn't work.
Any ideas? Remember, HotKeySet is not an option for me, and while _IsPressed can tell me if a key like F12 is pressed and send Q instead, it doesn't actually STOP F12 from sending, so I don't see how I can use that either. Thanks for any help.
This is my first script with AutoIT and I'm trying to do something EXTREMELY simple. I'm using the HotKey UDF Library http://www.autoitscript.com/forum/topic/90492-hotkey-udf/
I need to use this over HotKeySet because HotKeySet seems to be blocked in nearly every application I've tried it in, minus just default windows programs.
Here is my script:
[ autoit ]
#include <misc.au3> #Include <HotKeyUDF.au3> #Include <vkConstants.au3> ; Assign "F12" with Message() and set extended function call _HotKey_Assign($VK_F12, 'Message', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL)) ; Assign "CTRL-ESC" with Quit() _HotKey_Assign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') While 1 Sleep(10) WEnd Func Message($iKey) ;MsgBox(0, 'Hot key Test Message', 'F12 (0x' & Hex($iKey, 4) & ') has been pressed!') Send("{q}") EndFunc ;==>Message Func Quit() Exit EndFunc ;==>Quit
I'm trying a simple example where if I press F12, it presses the Q key instead. Problem is it just does NOT seem to work when I use Send(). If I uncomment the MsgBox function, that will activate if I press F12, but when I try to assign it to send a separate key, it just flat doesn't work.
Any ideas? Remember, HotKeySet is not an option for me, and while _IsPressed can tell me if a key like F12 is pressed and send Q instead, it doesn't actually STOP F12 from sending, so I don't see how I can use that either. Thanks for any help.