[Donion] [1.1.87] Capslock-ctrl remapping failing in linux

PostmodernPrometheus
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu Jul 20, 2023 4:03 am
Contact:

[Donion] [1.1.87] Capslock-ctrl remapping failing in linux

Post by PostmodernPrometheus »

Similar to 106031 but I see this in 1.1.87 and maybe not precisely the same.

I remap CapsLock to ctrl in linux using gnome-tweaks version 42.beta
Failure:
When I enable gnome-tweaks setting "Keyboard & Mouse"->"Additional Layout Options"->"Caps Lock behavior"->"Make Caps Lock an additional Ctrl", the CapsLock key is ignored in Factorio (for example "CapsLock+x" acts as "x" alone). Other linux applications understand CapsLock as control with this configuration.

The output of xmodmap in this case
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):

shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Caps_Lock (0x42), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
Workaround:
I tried setting "Keyboard & Mouse"->"Additional Layout Options"->"Caps Lock behavior"->"Disabled"
and "Keyboard & Mouse"->"Additional Layout Options"->"Ctrl position"->"Caps Lock as ctrl" and both the Caps Lock and ctrl keys act as control in Factorio

The output of xmodmap in this case
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):

shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_L (0x42), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
More System info:
OS Name: Pop!_OS 22.04 LTS
GNOME version: 42.9
Windowing System: X11
I use the default GNOME desktop which is "GNOME Shell 42.5"
Attachments
factorio-current.log
(5.72 KiB) Downloaded 77 times
PostmodernPrometheus
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu Jul 20, 2023 4:03 am
Contact:

Re: [Donion] [1.1.87] Capslock-ctrl remapping failing in linux

Post by PostmodernPrometheus »

Just to confirm: I do have a workaround that works for me.

I attached xev output for failure and for my workaround.
Attachments
workaround_output.txt
(7.7 KiB) Downloaded 74 times
failure_output.txt
(14.48 KiB) Downloaded 72 times
Donion
Factorio Staff
Factorio Staff
Posts: 302
Joined: Sun Aug 22, 2021 9:18 am
Contact:

Re: [Donion] [1.1.87] Capslock-ctrl remapping failing in linux

Post by Donion »

Thank you for the report. I can reproduce it on my end and (I think) I understand what is happening.
Proper fix would most likely mean a bigger change in how Factorio handles key events which I don't really want to do right now.
Given that you have a workaround that works for you I'm inclined to leave this as a known minor issue. For now I'm keeping this in assigned, I might think about it more and change my mind.
PostmodernPrometheus
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu Jul 20, 2023 4:03 am
Contact:

Re: [Donion] [1.1.87] Capslock-ctrl remapping failing in linux

Post by PostmodernPrometheus »

Sounds good, hopefully my workaround has enough info to help anyone else who hits this.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 579
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [Donion] [1.1.87] Capslock-ctrl remapping failing in linux

Post by raiguard »

I have had good results using keyd for remapping my capslock to ctrl/escape. It's not built-in to gnome, but it might work for you as well.
Don't forget, you're here forever.
Post Reply

Return to “Assigned”