Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemctl restart keyd.service break the capslock mapping #897

Open
mcgaw opened this issue Dec 24, 2024 · 4 comments
Open

systemctl restart keyd.service break the capslock mapping #897

mcgaw opened this issue Dec 24, 2024 · 4 comments

Comments

@mcgaw
Copy link

mcgaw commented Dec 24, 2024

Linux 6.8.0-49-generic
Ubuntu 24.04
keyd 2.5

I have a basic config:

[ids]

*

[main]

# Remaps the escape key to capslock
esc = capslock


# Maps capslock to escape when pressed and control when held.
capslock = overload(control, esc)

It runs as a systemd service.

When the computer starts everything seems fine.

However, when I reload the service it breaks. The capskey loses the tapping escape behaviour and regains capslock (although strangely the control behaviour remains).

The output from keyd -m remains the same.

I'm not sure how to debug further. The logs don't reveal anything (same for when starting with the system and after the restart).

Presumably it's to do with X running when the service is restarted.

(Incidentally, the reason I found this out is the keyd mappings just stopped working randomly, so I started looking at restart etc. Unfortunately I didn't capture any logs.)

@rvaiya
Copy link
Owner

rvaiya commented Dec 27, 2024

The output from keyd -m remains the same.

Can you elaborate? Do you mean the output sequences are correct when you run keyd monitor? Can you post the output of the daemon itself?

@mcgaw
Copy link
Author

mcgaw commented Dec 28, 2024

Hi, yes, looking at the output of keyd monitor one would think that everything was working as per the config.

Log showing restart:

Dec 28 17:30:27 e119742 systemd[1]: Started keyd.service - key remapping daemon.
Dec 28 17:30:27 e119742 keyd[1433]: CONFIG: parsing /etc/keyd/default.conf
Dec 28 17:30:27 e119742 keyd[1433]: Starting keyd v2.5.0 (f33dca8)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: match    0001:0001:a38e6885  /etc/keyd/default.conf        (AT Translated Set 2 keyboard)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: match    04b4:6001:4f270a38  /etc/keyd/default.conf        (HID 04b4:6001)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: ignoring 04b4:6001:60cd22a0  (HID 04b4:6001 Mouse)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: match    04b4:6001:71abb029  /etc/keyd/default.conf        (HID 04b4:6001 Consumer Control)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: match    04b4:6001:e24897ac  /etc/keyd/default.conf        (HID 04b4:6001 Keyboard)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: ignoring 17ef:608d:0f8e418f  (PixArt Lenovo USB Optical Mouse)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: ignoring 04f3:2398:d2919025  (ELAN Touchscreen)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: match    17aa:5054:101d4f25  /etc/keyd/default.conf        (ThinkPad Extra Buttons)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: match    0000:0006:bdb72f48  /etc/keyd/default.conf        (Video Bus)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: ignoring 0fac:1ade:d2b36ae6  (keyd virtual pointer)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: ignoring 04f3:0020:2111b95b  (Elan Touchpad)
Dec 28 17:30:27 e119742 keyd[1433]: DEVICE: ignoring 04f3:0020:e1b87864  (Elan TrackPoint)
Dec 28 17:39:58 e119742 systemd[1]: Stopping keyd.service - key remapping daemon...
Dec 28 17:39:58 e119742 systemd[1]: keyd.service: Main process exited, code=exited, status=15/n/a
Dec 28 17:39:58 e119742 systemd[1]: keyd.service: Failed with result 'exit-code'.
Dec 28 17:39:58 e119742 systemd[1]: Stopped keyd.service - key remapping daemon.
Dec 28 17:39:58 e119742 systemd[1]: Started keyd.service - key remapping daemon.
Dec 28 17:39:58 e119742 keyd[3790]: CONFIG: parsing /etc/keyd/default.conf
Dec 28 17:39:58 e119742 keyd[3790]: Starting keyd v2.5.0 (f33dca8)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: match    0001:0001:a38e6885  /etc/keyd/default.conf        (AT Translated Set 2 keyboard)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: match    04b4:6001:4f270a38  /etc/keyd/default.conf        (HID 04b4:6001)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: ignoring 04b4:6001:60cd22a0  (HID 04b4:6001 Mouse)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: match    04b4:6001:71abb029  /etc/keyd/default.conf        (HID 04b4:6001 Consumer Control)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: match    04b4:6001:e24897ac  /etc/keyd/default.conf        (HID 04b4:6001 Keyboard)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: ignoring 17ef:608d:0f8e418f  (PixArt Lenovo USB Optical Mouse)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: ignoring 04f3:2398:d2919025  (ELAN Touchscreen)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: match    17aa:5054:101d4f25  /etc/keyd/default.conf        (ThinkPad Extra Buttons)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: match    0000:0006:bdb72f48  /etc/keyd/default.conf        (Video Bus)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: ignoring 04f3:0020:2111b95b  (Elan Touchpad)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: ignoring 04f3:0020:e1b87864  (Elan TrackPoint)
Dec 28 17:39:58 e119742 keyd[3790]: DEVICE: ignoring 0fac:1ade:d2b36ae6  (keyd virtual pointer)

After the restart tapping the capslock key no longer functions as escape - but reverts to capslock.

I'm using a USB keyboard so I'll remove that from the equation and report back.

Edit: It doesn't seem related to USB keyboard.

@rvaiya
Copy link
Owner

rvaiya commented Dec 28, 2024

Hi, yes, looking at the output of keyd monitor one would think that everything was working as per the config.
After the restart tapping the capslock key no longer functions as escape - but reverts to capslock.

So keyd monitor is still showing escape, but you believe capslock is being activated? If so, please post the output of both evtest and keyd monitor while pressing capslock after you have reproduced the problem.

@mcgaw
Copy link
Author

mcgaw commented Dec 29, 2024

Yes, keyd monitor is showing escape but in actual fact caps-lock is being activated.

I've attached output for before and after service restart.

I pointed evtest at the keyd virtual keyboard; I don't know if that's what you inferred. Thanks!

before.txt
after.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants