vardahoth Posted June 25, 2019 Share Posted June 25, 2019 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? Link to comment Share on other sites More sharing options...
BrewManNH Posted June 25, 2019 Share Posted June 25, 2019 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 GudeHow 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 Link to comment Share on other sites More sharing options...
vardahoth Posted June 25, 2019 Author Share Posted June 25, 2019 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. Link to comment Share on other sites More sharing options...
vardahoth Posted June 25, 2019 Author Share Posted June 25, 2019 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... Link to comment Share on other sites More sharing options...
BrewManNH Posted June 26, 2019 Share Posted June 26, 2019 I get 0 back from the hotkeyset command, meaning it failed to set the key. Might be a bug, or a documentation error. Xandy 1 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 GudeHow 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 Link to comment Share on other sites More sharing options...
vardahoth Posted June 26, 2019 Author Share Posted June 26, 2019 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. Link to comment Share on other sites More sharing options...
argumentum Posted June 26, 2019 Share Posted June 26, 2019 (edited) 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 June 26, 2019 by argumentum better code Xandy 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
vardahoth Posted June 26, 2019 Author Share Posted June 26, 2019 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. Link to comment Share on other sites More sharing options...
vardahoth Posted June 26, 2019 Author Share Posted June 26, 2019 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]" Link to comment Share on other sites More sharing options...
Exit Posted June 26, 2019 Share Posted June 26, 2019 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() Link to comment Share on other sites More sharing options...
Earthshine Posted June 26, 2019 Share Posted June 26, 2019 (edited) 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 June 26, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
BrewManNH Posted June 26, 2019 Share Posted June 26, 2019 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 vardahoth and Earthshine 2 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 GudeHow 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 Link to comment Share on other sites More sharing options...
vardahoth Posted June 26, 2019 Author Share Posted June 26, 2019 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... Link to comment Share on other sites More sharing options...
Developers Jos Posted June 26, 2019 Developers Share Posted June 26, 2019 Try now. (You were still part of the New Members group which isn't allowed to change posts) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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