Hello,
I did not run your script, but the strings in the third parameter would not work within AHK. These should actually be numbers (0x70, 0x71). You can use a variable (unquoted) if you define it in advance. One clue about this is the preceding parameter, which is
UInt, indicating an
unsigned integer. Another clue will be the error message that appears, "Expected a Number but got a String".
To prevent confusion, I suggest that
A_ should be avoided as leading text of a new variable name, because AHK uses this for its built-in variables.
:= is always assignment, never comparison.
Code: Select all
#Requires AutoHotkey v2.0
A_DPIOriginal := 5
If A_DPIOriginal := 0
MsgBox "It's neither zero nor null"
Else MsgBox "It's zero or null"
This original code was for v1
Your script was not translated (directly and thoroughly and accurately) from a working v1 script, as this same approach would also not work in v1.
Although the numpad can be tricky to use, when I think my hotkey is not working, I run a simple test.
Code: Select all
#Requires AutoHotkey v2.0
<^NumpadEnd::MsgBox 'Shifted 1'
I'm sure my code is correct
This statement has no basis. You can believe that you are always right, but it won't help you debug any of your scripts.