Key is case sensitive in some cases Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
MortenZdk
Posts: 9
Joined: 25 Aug 2018, 06:02

Key is case sensitive in some cases

11 Sep 2018, 08:02

For some reason, the "A" hotkey used below is case sensitive, and an "Error: Duplicate hotkey" is reported for "<^>!+A::Media_Play_Pause" if the below is used:

Code: Select all

; Use of upper-case "A" hotkey gives error when loading
<^>!A::Media_Next
<^>!+A::Media_Play_Pause

; This works fine when using lower-case "b" hotkey
<^>!b::Media_Next
<^>!+b::Media_Play_Pause

; Upper-case hotkey can be used here, thus when not using Media_Next and Media_Play_Pause
<^>!C::MsgBox Lower-case P
<^>!+C::MsgBox Upper-case P
The other lines are OK, so looks like the case sensitive key is tied to use of Media_Next and Media_Play_Pause.

I have not seen case sensitive hotkey before, so this looks like a bug.
User avatar
TheDewd
Posts: 1307
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Key is case sensitive in some cases  Topic is solved

11 Sep 2018, 08:17

It's not the use of the "A" that is causing the error... It's the command you're trying to bind to that hotkey.

Try this:

Code: Select all

<^>!A::Send, {Media_Next}
<^>!+A::Send, {Media_Play_Pause}
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
MortenZdk
Posts: 9
Joined: 25 Aug 2018, 06:02

Re: Key is case sensitive in some cases

11 Sep 2018, 09:38

Thanks, using "Send, {Media_Next}" and "Send, {Media_Play_Pause}" makes it work with upper-case hotkey... though pretty weird that it almost worked before also ;-)

I would like to accept your answer, but I could not find a button to do that.
lexikos
Posts: 6447
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Key is case sensitive in some cases

12 Sep 2018, 17:39

"It's the command you're trying to bind to that hotkey" fails to make the important distinction: <^>!A::Media_Next is not a hotkey, but a remapping (the defining point is that it has a key name to the right of ::). A remapping is effectively a macro which is replaced with two hotkeys (of the form described in the documentation). The issue is that hotkeys ignore case, while remapping treats A is +a. In this case, the two remappings would create hotkeys *+<^>!A, *+<^>!A up, *+<^>!+A and *+<^>!+A up, where the redundant + is ignored.

Return to “Ask For Help”

Who is online

Users browsing this forum: begenner at Ahk, contabaiswa, Google [Bot], ianjf, Odlanir, teadrinker and 196 guests