seres Posted April 15, 2008 Posted April 15, 2008 i got interested in a topic it says: HotKeySet("b","b_pressed") Func b_pressed() Send("b") EndFunc and it doesnt sends anything, so is that a bug or if not then how after u press b it sends b
FreeFry Posted April 15, 2008 Posted April 15, 2008 No it's not a bug. It's kind of obvious what it does: HotKeySet button B to a function that sends it, and it will cause a loop, over and over again. To actually send the key that is hooked you'd have to 'unhook' it in the function. Something like: HotKeySet("b", "b_pressed") While 1 Sleep(250) WEnd Func b_pressed() HotKeySet("b") Send("b") HotKeySet("b", "b_pressed") EndFunc
FreeFry Posted April 15, 2008 Posted April 15, 2008 (edited) Or you could do something more elegant, like this: HotKeySet("b", "_SendHotKey") While 1 Sleep(250) WEnd Func _SendHotKey() Local $svKey = @HotKeyPressed HotKeySet($svKey) TrayTip("", $svKey & " was pressed", 5) Send($svKey) HotKeySet($svKey, "_SendHotKey") EndFunc That way, you only need one function for all of your keys(if you intend to use it with several that is). Edited April 15, 2008 by FreeFry
smashly Posted April 15, 2008 Posted April 15, 2008 Hi, use the ASCII value for the Send().#include <misc.au3> HotKeySet("b","b_pressed") While (Not _IsPressed("1B")) Sleep(100) WEnd Func b_pressed() Send("{ASC 098}") EndFunc Cheers
seres Posted April 15, 2008 Author Posted April 15, 2008 Or you could do something more elegant, like this: HotKeySet("b", "_SendHotKey") While 1 Sleep(250) WEnd Func _SendHotKey() Local $svKey = @HotKeyPressed HotKeySet($svKey) TrayTip("", $svKey & " was pressed", 5) Send($svKey) HotKeySet($svKey, "_SendHotKey") EndFunc That way, you only need one function for all of your keys(if you intend to use it with several that is). thanks
seres Posted April 15, 2008 Author Posted April 15, 2008 Hi, use the ASCII value for the Send().#include <misc.au3> HotKeySet("b","b_pressed") While (Not _IsPressed("1B")) Sleep(100) WEnd Func b_pressed() Send("{ASC 098}") EndFunc Cheers thanks
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