Jump to content
Sign in to follow this  
vardahoth

Windows 10, (Windows Key + letter) doesn't work

Recommended Posts

I have a list of scripts I have brought over when I migrated to windows 10 today. This script was working (confirmed last week and unchanged) on windows 7, but windows 10 seems to have an issue with this.

HotKeySet ("#{j}", "StartTests")

However... if I strip out the windows key, just the j works fine

HotKeySet ("j", "StartTests")

 

Here is the full script...

Func Quit()
   Exit
EndFunc

Func StartTests()
   Send("Hello World")

   ; comment out function Quit() to keep script running until ESC key is pressed
   ;Quit()
EndFunc

;***********************
;* program starts here *
;***********************
HotKeySet ("#{j}", "StartTests") ; Calls function to start program
HotKeySet ("{ESC}", "Quit") ; Calls function to exit program immediately

;wait for the hotkey to be pressed
While 1
    Sleep(100)
WEnd

I've tried turning off anti-virus (coming with windows defender) and firewall. I have autoit set to run as admin. I have x64 version installed. I am running windows 10 pro x64. The regular windows key works (brings up the start menu), of course not during the script running though...

 

Anyone have any idea why this works with windows 7, but not with windows 10?

Share this post


Link to post
Share on other sites
HotKeySet ("#j", "StartTests") ; Calls function to start program

Try that


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
1 minute ago, BrewManNH said:
HotKeySet ("#j", "StartTests") ; Calls function to start program

Try that

Hello, ty for the reply. I did try that (double checking the docs), and it doesn't work either.

Share this post


Link to post
Share on other sites

note, I also remember giving my scripts to a friend when he had win10, and he ran into the same issue. We never solved it. I was hoping it would be solved by now by some update...

Share this post


Link to post
Share on other sites

I get 0 back from the hotkeyset command, meaning it failed to set the key. Might be a bug, or a documentation error.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
10 minutes ago, BrewManNH said:

I get 0 back from the hotkeyset command, meaning it failed to set the key. Might be a bug, or a documentation error.

A bug on Microsoft's part or a bug on AutoIT's part? Because it works in windows 7.

Share this post


Link to post
Share on other sites

must be a reserved key for the newer versions of the OS
You can look for a free one ;) 

#include <MsgBoxConstants.au3>
HotKeySet("{ESC}", "Terminate")
Global $iret, $letter = Asc('j')
Do
    $iret = HotKeySet("#" & Chr($letter), "ShowMessage")
    If Not $iret Then $letter += 1
    If $letter > 200 Then
        ConsoleWrite(@CRLF & '! none found !!!' & @CRLF& @CRLF)
        MsgBox($MB_SYSTEMMODAL, "", 'No Win + "letter" worked.' , 2)
        Exit 5
    EndIf
Until $iret
ConsoleWrite(@CRLF & 'The key is Win + ' & Chr($letter) & @CRLF& @CRLF)
MsgBox($MB_SYSTEMMODAL, "", 'The key is Win + ' & Chr($letter), 2)
While 1
    Sleep(100)
WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

Func ShowMessage()
    MsgBox($MB_SYSTEMMODAL, "", "This is a message.")
EndFunc   ;==>ShowMessage

Do change the title of the first post and add "[Solved]", as there is no bug and does work ( other than reserved ) :) 

Edited by argumentum
better code

Share this post


Link to post
Share on other sites
2 hours ago, argumentum said:

must be a reserved key for the newer versions of the OS
You can look for a free one ;) 

#include <MsgBoxConstants.au3>
HotKeySet("{ESC}", "Terminate")
Global $iret, $letter = Asc('j')
Do
    $iret = HotKeySet("#" & Chr($letter), "ShowMessage")
    If Not $iret Then $letter += 1
    If $letter > 200 Then
        ConsoleWrite(@CRLF & '! none found !!!' & @CRLF& @CRLF)
        MsgBox($MB_SYSTEMMODAL, "", 'No Win + "letter" worked.' , 2)
        Exit 5
    EndIf
Until $iret
ConsoleWrite(@CRLF & 'The key is Win + ' & Chr($letter) & @CRLF& @CRLF)
MsgBox($MB_SYSTEMMODAL, "", 'The key is Win + ' & Chr($letter), 2)
While 1
    Sleep(100)
WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

Func ShowMessage()
    MsgBox($MB_SYSTEMMODAL, "", "This is a message.")
EndFunc   ;==>ShowMessage

Do change the title of the first post and add "[Solved]", as there is no bug and does work ( other than reserved ) :) 

Looks like you are right, windows 10 added A LOT of shortcut keys with the windows key. And because of this, the shortcut I've been using since 2008 can no longer be used. (Sad Day)

 

For anyone else reading this...

Here are the available key combinations you can use with the windows key (for Windows 10😞

"  '  -  /  :  <  >  ?  A  B  D  E  F  G  H  I  J  K  L  N  O  Q  R  U  X  Y  Z  [  \  ]  _  `  n  y  |  }  ~

Note: I also tried following these guides to turn off Windows Hot Keys using gpedit and/or regedit... but it didn't work for me:

https://answers.microsoft.com/en-us/windows/forum/all/how-to-disable-hot-keys/be2f571c-01f4-4f8c-af8d-3ffa71fd3d3b

https://www.isumsoft.com/it/disable-win-keyboard-shortcuts-in-windows-10/

If anyone finds a solution to disable windows hotkeys (that works), feel free to reply, otherwise, I recommend just sticking with the work-around of the available key combo's for the (Windows+X) keys I listed.

Share this post


Link to post
Share on other sites
3 hours ago, argumentum said:

Do change the title of the first post and add "[Solved]", as there is no bug and does work ( other than reserved ) :) 

Looks like it won't let me edit my own post, or the title of the thread. But for anyone who has permissions to do so, feel free to change this to "[Solved]"

Share this post


Link to post
Share on other sites
4 hours ago, vardahoth said:

Looks like it won't let me edit my own post, or the title of the thread. But for anyone who has permissions to do so, feel free to change this to "[Solved]"

Try it again. You need at least 5 posts to change your posts. And this limit is reached.


App: Au3toCmd              UDF: _SingleScript()                             

Share this post


Link to post
Share on other sites

i love the hands-off of that key. i need it for all the windows shortcuts i constantly use. I really don't need a mouse, got that way in factories in the old days, I adapted and learned the goodness of the keyboard, then and now the windows key makes everything even easier

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites

Microsoft's documentation now says that the Windows Logo key shortcuts are reserved for the system and can't be remapped to another hotkey.

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-registerhotkey

 


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
5 hours ago, Exit said:

Try it again. You need at least 5 posts to change your posts. And this limit is reached.

still no option for me to do this...

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...