AHK_X11
AHK_X11 copied to clipboard
Hotkeys cease functioning when Caps Lock is on
Previous title: Hotkeys assigned to number row cease functioning when Caps Lock is on Distro: Xubuntu 24.04 running X on VMWare Workstation 17 Pro hypervisor Expected behavior (also noted in the docs)
Remapping a key or button is "complete" in the following respects: <...> CapsLock generally affects remapped keys in the same way as normal keys.
4::MsgBox, test
– works when Caps Lock is off, message box with "test" is displayed instead of "4" being sent as keyboard input. However, when Caps Lock is on, on the contrary, "4" is being sent as keyboard input.
I've taken means of troubleshooting this issue by prefixing the 4
here with modifiers, like *
, $
, ~
, however that didn't solve anything.
I'm left with an assumption that such behavior is a bug on behalf of AHK_X11.
PS. Please implement UTF-8/Unicode support whenever it's possible. It severely hinders my use cases for which I'd be using this program for, as I happen to be a non-English speaker, that deals with modified Latin alphabet outside ASCII on a daily basis. Nevertheless, it seems that I'm able to input the characters with Run, xdotool key [code]
, which appears to be a working solution in the meanwhile, albeit the increased typing latency from such "hack" is present. Otherwise kudos for taking a step forwards in replicating AutoHotkey for Linux.
Edit: Okay, it is a bug – ALL of the hotkeys break once keyboard is in Caps Lock state. Not just those within the scope of number row.
Also, it appears that there is no differentiation of lower-case and upper-case letters, as in this script:
Endkeys = {LControl}{RControl}{LAlt}{RAlt}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{Backspace}{Capslock}{Numlock}{PrintScreen}{Pause}
$4::
Input, key, L1, %Endkeys%
StringReplace, InviKey, ErrorLevel, EndKey:
IfInString, Endkeys, {%InviKey%}
{
Send {%InviKey%}
}
else
{
if key = i
Run, xdotool key U021B
else if key = I
Run, xdotool key U021A
else
Send %key%
}
if key = i
condition takes place despite the case, line Run, xdotool key U021B
gets executed. If Caps are on, NOTHING gets executed at all, and "I" is sent as input as usual.