You are not logged in.

#1 2024-01-01 14:48:50

DAMO238
Member
Registered: 2020-02-25
Posts: 51

[Solved] Xmodmap no longer has any effect outside of xev

I wanted to remap some keys on the fly. To do this I tend to use xmodmap. I ran the following two lines:

xmodmap -e "keycode 106 = KP_Divide backslash"
xmodmap -e "keycode 49 = grave bar backslash"

I previously ran these lines and the mapping changed correctly. However, after the latest update (which was quite large as I hadn't logged on over the holiday period), running these changes the output of

xmodmap -pke

and xev identifies the change, but nothing else does. I even tried doing

xmodmap -e "keycode 106 = backslash"

to see if the issue was with the modifier keys, but that had no effect either. At this point, I am quite stumped as to why the change is not being propagated to the rest of X. Any advice would be greatly appreciated.

Last edited by DAMO238 (2024-01-02 12:27:16)

Offline

#2 2024-01-01 15:26:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [Solved] Xmodmap no longer has any effect outside of xev

And what exactly is "nothing else"?
Are you maybe (now) running a wayland session?

loginctl session-status

Offline

#3 2024-01-01 17:28:01

DAMO238
Member
Registered: 2020-02-25
Posts: 51

Re: [Solved] Xmodmap no longer has any effect outside of xev

Thanks for your reply. By "nothing else", I mean that I tested a bunch of applications including alacritty, firefox, nheko, etc and none of them respect the xmodmap setting. I am not running Wayland, since I use i3 which doesn't support Wayland. This is confirmed by interrogating systemd as you suggested.

Offline

#4 2024-01-01 17:30:51

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [Solved] Xmodmap no longer has any effect outside of xev

setxkbmap -print -query

Offline

#5 2024-01-01 17:37:48

DAMO238
Member
Registered: 2020-02-25
Posts: 51

Re: [Solved] Xmodmap no longer has any effect outside of xev

Not really sure what to be looking for here. I recognise the base layout I use for my keyboard, but should I be seeing the changes from xmodmap here as well?

xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+gb+inet(evdev)+altwin(alt_super_win)+capslock(swapescape)"	};
	xkb_geometry  { include "pc(pc105)"	};
};
rules:      evdev
model:      pc105
layout:     gb
options:    caps:swapescape,altwin:alt_super_win

Last edited by DAMO238 (2024-01-01 17:38:38)

Offline

#6 2024-01-01 21:43:12

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [Solved] Xmodmap no longer has any effect outside of xev

I suspected a multi-layout setup (but it's not)
Do you use some kind of input method?

printenv

Does xterm also not reflect the expected keymap?

Offline

#7 2024-01-02 10:28:17

DAMO238
Member
Registered: 2020-02-25
Posts: 51

Re: [Solved] Xmodmap no longer has any effect outside of xev

So it was working in xterm, which led me down a road of investigating, from a developer perspective, how keyboard inputs are read. And it seems the culprit is a library called winit. It only affects one version as far as I can tell, but it made it so that it would not hot reload the xmodmap. This is verified by opening another instance of any affected program *after* making the change and seeing that the change works. Since I don't really want to move away from the official repos where possible, I will simply reinstantiate any faulty instances where needed and wait for an update with updated winit.

TL;DR: It is a bug in a commonly used library that has already been fixed on the development branch.

Thanks for all your help!

Last edited by DAMO238 (2024-01-02 10:28:32)

Offline

#8 2024-01-02 10:45:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [Solved] Xmodmap no longer has any effect outside of xev

culprit is a library called winit

https://docs.rs/winit/latest/winit/ ?

Butbutbut… I though if it's written in rust that means it's bugfree??
So that was a lie… tongue

If you're cmoing along this thread, rust is a make dep. for the mentioned clients only, what kinda hides the problem.

Thanks for the investigation and please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB