Volume control keys not working with scan code
RiccardoBarbieri opened this issue · 4 comments
I created the following mappings:
volumeMuteCmd = $(/home/riccardoob/scripts/audio-polybar/pulseaudio-control togmute) ^
volumeDownCmd = $(/home/riccardoob/scripts/audio-polybar/pulseaudio-control --volume-max 130 down) ^
volumeUpCmd = $(/home/riccardoob/scripts/audio-polybar/pulseaudio-control --volume-max 130 up) ^
173 >> volumeMuteCmd
174 >> volumeDownCmd
175 >> volumeUpCmd
to launch the scripts when I press the volume controls but it doesn't seem to work.
I tested with other mappings such as
173 >> Backspace
to understand if the problem was with the command definitions but it still does not work.
I tried using the event names and it works.
How can I get it to work with the scan codes? In the documentation it is not specified how to actually use them.
I define them as aliases and then use like any other key like below, but they do work with just the number if you prefer to do that. Are you sure the scan codes are correct?
# AVRCP media keys (hex values are just a comment for my self)
MediaPlay = 200 # 0x00C8
MediaPause = 201 # 0x00C9
MediaPlay >> some_action
@ristomatti yes, I used the web tool suggested in the documentation to get the codes, same for the names that I ended up using since with those it works.
@RiccardoBarbieri Just to clarify, the key codes shown on https://www.toptal.com/developers/keycode aren't the same as scan codes, I got confused by this initially also. The site is only useful for finding the key names used by Keymapper.
To find out the scan codes you'll need some other tool. I'm not on Windows so I don't know which one to recommend. Based on a quick search you'll find one easily in case you run across a key that's not recognized by Toptal.