Jump to content

"WIN" key and hotkeyset()...


 Share

Recommended Posts

I am trying to use the WIN key as part of a hotkey combination with the RIGHT, LEFT, UP, DOWN arrow keys. It works fine if I use the Ctrl (^) key, or the Alt :graduated: key, but for some reason the WIN (#)? key won't work in the same way. I have tried various combinations such as:

HotKeySet("#{RIGHT}", "RUN_FUNC")

HotKeySet("#+{RIGHT}", "RUN_FUNC")

HotKeySet("{LWIN}+{RIGHT}", "RUN_FUNC")

HotKeySet("{LWIN}{RIGHT}", "RUN_FUNC")

None of those seem to work, however using,

HotKeySet("^{RIGHT}", "RUN_FUNC") -works fine for Ctrl + RIGHT arrow

HotKeySet("!{RIGHT}", "RUN_FUNC") -works fine for Alt + RIGHT arrow

I did a quick search in the forums, but did not find what I was looking for. Any help is really appreciated.

Guy.

Link to comment
Share on other sites

From helpfile:

The following hotkeys cannot be set:

Ctrl+Alt+Delete It is reserved by Windows F12 It is also reserved by Windows, according to its API.

NumPad's Enter Key Instead, use {Enter} which captures both Enter keys on the keyboard.

Win+B,D,E,F,L,M,R,U; and Win+Shift+M These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above.

Alt, Ctrl, Shift, Win These are the modifier keys themselves!

Other Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.

Link to comment
Share on other sites

Thanks for your reply.

I did check the helpfile, and I saw the part I think you are referring to. However for some reason it works fine with Alt and Ctrl. I have not actually tried Shift.

If anyone does know a way to use the WIN key in a hotkey combination, such as that described in my original post, your assistance would be greatly appreciated.

Thanks in advance to any who can offer suggestions,

Guy.

From helpfile:

The following hotkeys cannot be set:

Ctrl+Alt+Delete It is reserved by Windows F12 It is also reserved by Windows, according to its API.

NumPad's Enter Key Instead, use {Enter} which captures both Enter keys on the keyboard.

Win+B,D,E,F,L,M,R,U; and Win+Shift+M These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above.

Alt, Ctrl, Shift, Win These are the modifier keys themselves!

Other Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.

Link to comment
Share on other sites

This works on my machine, with the HotKeySet lines being almost exactly a copy/paste from your post. I wish I could make a more helpful suggestion as to why it won't work for you.

HotKeySet("^{RIGHT}", "Control_Func")
HotKeySet("#{RIGHT}", "Win_Func")

While 1
    Sleep(100)
WEnd

Func Control_Func()
    ConsoleWrite("Control Key" & @LF)
EndFunc

Func Win_Func()
    ConsoleWrite("Win Key" & @LF)
EndFunc

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

This works on my machine, with the HotKeySet lines being almost exactly a copy/paste from your post. I wish I could make a more helpful suggestion as to why it won't work for you.

somdcomputerguy and guysmilie, which version of Windows are both of you using? Windows 7 uses these keys (Win + arrow keys) by default to move windows around the screen.

Link to comment
Share on other sites

Oh silly me, I didn't even think enough.. If you, guysmilie, are using 7, then you are probably out of luck. You may be able to use this function, _IsPressed, and I'm pretty sure there's a HotKey and/or an IsPressed UDF out there. Try searching in the Example Scripts forum.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

Thanks very much for the replies, I really appreciate it!

Yes I am using windows 7, so it appears that may be the problem. I will try to check out this _Ispressed thing you mention. I am not totally sure how that is supposed to work, would it take control of this key back from Windows 7 so I can use it?

Anyway, thanks for all the ideas,

Guy.

Link to comment
Share on other sites

  • 5 years later...

Hello guysmilie, I know this is an old post, but since I found it, others might do so too.

 

Yes you can disable the WIndows HotKeys, but unfortunately I don't know a way to disable only some of them.

 

This is how you disable/enable all of the windows hotkeys:

Go to the registry: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer] and add a DWORD  and name it "NoWinKeys". Set the value to "1" in order to enable the WInKeys or to "0" to disable them.

You have to restart your computer so the new registry entry takes effect.

 

Cheers, CardKeyOh

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