WindowPadX stopped working after reboot (Windows 10) - help!

Get help with using AutoHotkey and its commands and hotkeys
sm1ng
Posts: 3
Joined: 12 Sep 2018, 08:50

WindowPadX stopped working after reboot (Windows 10) - help!

12 Sep 2018, 09:17

Hey,

firstly I want to say that I love AHK and try to get all my colleagues using it. Second, windowpadx has stopped working after I rebooted my machine (Windows 10). Any Hotkey I use, when depressed, now gives the
Error retrieving primary key of hotkey in Hotkeys().
error from WindowPadX.ahk, line 314. This happens for RAlt, AppsKey - any/all of them.

The error dialog :
---------------------------
WindowPadX.ahk
---------------------------
Error retrieving primary key of hotkey in Hotkeys().
Hotkey: RAlt
Result:
Please inform Lexikos. Tip: Press Ctrl+C to copy this message.
---------------------------
OK
---------------------------
remains up and the Hotkey remains depressed (even though I'm not touching it) such that when I hit "w" (for making window wide) or space (for moving window to other screen), the key combo is fired. If I suspend WindowPadX, this behaviour resolves.

Has anyone seen this? Anyone know what might be wrong? AFAIK there were no Windows Updates during the reboot. This is with the latest version 1.2.2 Gah! :thumbdown:
Thanks, Pete
lexikos
Posts: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: WindowPadX stopped working after reboot (Windows 10) - help!

12 Sep 2018, 17:17

Find the block RegExMatch(this_hotkey, key_regex, m) and replace it with this:

Code: Select all

if (!(p := RegExMatch(this_hotkey, key_regex, m)) || GetKeyState(m1)="") {
    MsgBox, % "Error retrieving primary key of hotkey in Hotkeys().`n"
            . "`tHotkey: " this_hotkey "`n"
            . "`tPosition: " p "`n"
            . "`tMatches: " m "," m1 "`n"
            . "`tErrorLevel: " ErrorLevel
    return
}
This might give us more useful information.
sm1ng
Posts: 3
Joined: 12 Sep 2018, 08:50

Re: WindowPadX stopped working after reboot (Windows 10) - help!

17 Sep 2018, 09:25

lexikos wrote:Find the block... This might give us more useful information.
Hi lexikos, thanks so much for the prompt assistance. Here's what I see:
---------------------------
WindowPadX.ahk
---------------------------
Error retrieving primary key of hotkey in Hotkeys().
Hotkey: LAlt
Position: 1
Matches: C:\code\develop\apps\Hawk\FrontEnd\Maestro\Maestro,
ErrorLevel: 0
---------------------------
OK
---------------------------
Now this is useful since
C:\code\develop\apps\Hawk\FrontEnd\Maestro\Maestro
was the value of the System Environment variable %M%.

So, I removed that env var and other short ones I'd added, rebooted the machine and the WindowPadX behaviour has changed. Now I no longer see the error dialog but the LAlt key is now perpetually depressed. It's more than that though since I can type when focused in text boxes OK but not when outside them. Any ideas?

Pete
lexikos
Posts: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: WindowPadX stopped working after reboot (Windows 10) - help!

17 Sep 2018, 16:43

The script doesn't use m directly, so m returning an env var is not the issue. Anyway, I would add #NoEnv to the script.

My question is: how can RegExMatch succeed (return 1) but give an empty match for the input "LAlt" and pattern "^(?:.* & )?[#!^+&<>*~$]*(.+)"? It is not possible, because (.+) must match at least one non-newline character.

Code: Select all

this_hotkey := "LAlt"
key_regex := "^(?:.* & )?[#!^+&<>*~$]*(.+)"
p := RegExMatch(this_hotkey, key_regex, m)
MsgBox, % "Hotkey: " this_hotkey "`n"
        . "Position: " p "`n"
        . "Matches: " m "," m1 "`n"
        . "ErrorLevel: " ErrorLevel
This returns "Matches: LAlt,LAlt". What is StrLen(this_hotkey) in your case?

On AutoHotkey v2, m might appear empty because it is an object; but WindowPadX would not run on v2, and does not use the "O" (object) option.
sm1ng
Posts: 3
Joined: 12 Sep 2018, 08:50

Re: WindowPadX stopped working after reboot (Windows 10) - help!

25 Sep 2018, 15:51

lexikos wrote: ...
On AutoHotkey v2, m might appear empty because it is an object; but WindowPadX would not run on v2, and does not use the "O" (object) option.
So. I had to move desks at work, hence the late reply. I finally get round to trying WindowPadX and... it's working fine. I have no idea what happened. Thanks a lot for the help either way.
Pete

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot] and 214 guests