SkellySoul Posted March 12, 2012 Share Posted March 12, 2012 (edited) I am trying to fully understand how HotKeys work to help me with a quicklaunch program that I am planning on making.You would think that the HotKey functions would be simple and for the most part you would be right but littles things get passed by you/me sometimes...So now my problem is this, I realize that ^ is a special character and the code below works, however when we take a similar script we run into a problem for whatever reason.HotKeySet("{^}", "_Test") While 1 Sleep(1000) WEnd Func _Test() MsgBox(0 , "", @HotKeyPressed) EndFuncFor $i = 0 To 255 HotKeySet(Chr($i), "_Test") Next While 1 Sleep(1000) WEnd Func _Test() MsgBox(0 , "", @HotKeyPressed) MsgBox(0 , "", String(@HotKeyPressed)) EndFuncI made this script as a proof of concept showing that virtually all the keys show up in a message box except for special characters...I am not to concerned about enter/backspace characters or anything of that matter but the special characters are important to me: such as #, +, ^ etc...Thanks[Edited]What I am looking for is to make the last piece of code I posted , to work. Edited March 12, 2012 by SkellySoul Link to comment Share on other sites More sharing options...
Realm Posted March 12, 2012 Share Posted March 12, 2012 (edited) Try using the base element of the key... in ect the number. Last I checked, those special characters do not have their own keys, and are only outputted with a shift modifier. In example... if you want to set the # key as a hot key...it's actually '3'. HotKeySet( '{3}', 'MyFunk') While 1 Sleep(10) WEnd Func MyFunk() MsgBox( '', 'Pressed!', 'Hot Key was Pressed!') EndFunc Edit: Or you could use Shift+3 HotKeySet('+{3}', 'MyFunk') Edited March 12, 2012 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
SkellySoul Posted March 12, 2012 Author Share Posted March 12, 2012 (edited) This seems to work except that now this key } won't popup but I think everything else is working...any idea's For $i = 0 To 255 HotKeySet("{" & Chr($i) & "}", "_Test") Next While 1 Sleep(1000) WEnd Func _Test() MsgBox(0 , "", StringTrimLeft(StringTrimRight(@HotKeyPressed, 1), 1)) EndFunc Edited March 12, 2012 by SkellySoul Link to comment Share on other sites More sharing options...
SkellySoul Posted March 12, 2012 Author Share Posted March 12, 2012 Aw, very nice, thanks again 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