Jump to content

@HotKeyPressed


Recommended Posts

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)
EndFunc

For $i = 0 To 255
    HotKeySet(Chr($i), "_Test")
Next

While 1
    Sleep(1000)
WEnd

Func _Test()
    MsgBox(0 , "", @HotKeyPressed)
    MsgBox(0 , "", String(@HotKeyPressed))
EndFunc

I 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 by SkellySoul
Link to comment
Share on other sites

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 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

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 by SkellySoul
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...