You are not logged in.
Hi,
How can I identify which process or processes are capturing my keypresses?
The reason that I am asking this is because it seems that a process listening to X is capturing them. I reached this conclusion because after running
$ xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'pressing those keys does not display anything in the terminal. However, when I run
$ xinit /usr/bin/xterm -- :1from a clean X session they do display what I'd expect: XF86AudioRaiseVolume, XF86AudioLowerVolume, XF86AudioMute, and XF86MicMute. (Process above found in https://wiki.archlinux.org/title/Keyboa … es_in_Xorg ).
My end goal is mapping these to amixer as suggested in https://wiki.archlinux.org/title/Advanc … me_control.
If this is not the right direction to follow in order to troubleshoot this, could someone point me in the right direction instead?
Thanks.
Last edited by tank (2022-04-17 19:32:36)
Offline
The easiest way would be for you to just tell us: what do you normally run when not testing with xinit / xterm?
Media keys would commonly be bound by any major DE. And while most standalone WMs allow configuring of key bindings, the default or example configs for quite a few of them would have entries already for binding media keys.
Last edited by Trilby (2022-04-17 13:16:08)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
xdotool key "XF86LogGrabInfo" will dump all grabs into the xorg log.
If you delay it in a way so that it fires when you press the shortcut, it will be listed as active grab (what makes easier to identify)
Offline
The easiest way would be for you to just tell us: what do you normally run when not testing with xinit / xterm?
Media keys would commonly be bound by any major DE. And while most standalone WMs allow configuring of key bindings, the default or example configs for quite a few of them would have entries already for binding media keys.
Thank you for the pointer. Indeed, after looking into my i3 config I found what seemed to be getting in the way:
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3statusUncommenting those and xbinding to alsamixer/amixer did the trick.
There's still something I can't wrap my head around and that is the difference in keycodes for the same keys in xmodmap vs showkeys (i.e. for xmodmap -pke, keycode 122 = XF86AudioLowerVolume whereas in showkeys --keycodes that same key is keycode 114). But I guess that's a topic for another thread. Edit: Xorg keycodes are larger than Linux keycodes as stated in https://wiki.archlinux.org/title/Keyboa … es_in_Xorg.
xdotool key "XF86LogGrabInfo"will dump all grabs into the xorg log.
If you delay it in a way so that it fires when you press the shortcut, it will be listed as active grab (what makes easier to identify)
Thank for you the trick. I'll keep it handy.
Marking as solved.
Last edited by tank (2022-04-18 10:22:20)
Offline