Summary
I switched to i3wm and I'm trying to set up my environment. I am using an Apple keyboard (circa 2007). It has three volume keys and I can't find their keycodes for mapping.
Analysis
I read some other online guides for how to determine the keycode. I tried using xev
to find out what keys these are, but it doesn't return me a keycode… only an output that doesn't seem to make sense.
FocusOut event, serial 33, synthetic NO, window 0x2200001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 33, synthetic NO, window 0x2200001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 33, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
FocusOut event, serial 33, synthetic NO, window 0x2200001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 33, synthetic NO, window 0x2200001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 33, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The first three "blocks" are from one press of the "volume up" key, and the last three are from the "volume down" key. From this info, I'm unable to figure out what the keycode is so that I can make a mapping for volume in my system.
Before this, I was using GNOME (Fedora 25) and GNOME was able to use the volume keys correctly. So I don't think this is an issue of the kernel not being able to detect the keys, because somehow, GNOME was able to do it.
Expected behavior
- Press "volume down" key in
xev
- Get key code
- Add to bindings to i3wm config
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% # Increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% # Decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # Mute sound
- Adjust system volume with volume keys
Actual behavior
- Press "volume down" key in
xev
- Receive different output that doesn't seem to have a key code
xev
unless you stop this application or configure it to ignore those keys. Close everything uncessary, then usexlsclients
to see which X applications are still running.i3wm
itself may steal the events if you already have configured it to do so.