You are not logged in.

#1 2013-12-23 01:29:18

qubodup
Member
Registered: 2008-01-19
Posts: 66

Cherry G230 Keyboard (PS/2) Extra Keys

11504914513_c43e3d80a9.jpg
Hello,

I'm trying to use my multi-media keys on my Cherry G230 (only volume +/-/mute, since media playback happens in flash/youtube 99% of the time).

The keyboard is connected via a USB-to-PS/2 adapter. I would like to keep it that way to save available USB connections.

According to xev (command used from https://wiki.archlinux.org/index.php/Ex … ys#In_Xorg ), only the XF86AudioPlay button is set/bound correctly, all others create the following output:

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

This probably means that their scancodes are not mapped to keycodes.

According to showkey --scancodes, the scancodes are:

0xe0 0x2e # volume- down
0xe0 0xae # volume- up
0xe0 0x20 # volumeMute down
0xe0 0xa0 # volumeMute up
0xe0 0x30 # volume+ down
0xe0 0xb0 # volume+ up
0xe0 0x10 # previous down
0xe0 0x90 # previous up
0xe0 0x22 # play/pause down
0xe0 0xa2 # play/pause up
0xe0 0x19 # next down
0xe0 0x99 # next up

(down = press, up = release)

According to showkey --keycodes, the keycodes are:

keycode 114 press #volume-
keycode 114 release
keycode 113 press #volumeM
keycode 113 release
keycode 115 press #volume+
keycode 115 release
keycode 165 press #back
keycode 165 release
keycode 164 press #play/pause
keycode 164 release
keycode 163 press #next
keycode 163 release

This is superfluous information though, since I'm just trying to achieve multimedia key support in Xorg. These are not the Xorg keycodes, the Xorg keycode 114 for example is the right arrow key.

According to xmodmap, bindings (mappings) for keycodes already exist:

$ xmodmap -pke |grep -e AudioMute -e AudioLower -e AudioRaise
keycode 121 = XF86AudioMute NoSymbol XF86AudioMute
keycode 122 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume

so all I have to do is bind (map) scancodes to keycodes (in Xorg) and make the events call alsamixer commands.

Binding (mapping) scancodes to keycodes in Xorg

Following https://wiki.archlinux.org/index.php/Ma … o_keycodes (I highly recommend to open the /usr/lib/udev/hwdb.d/60-keyboard.hwdb file as a source of examples), I create /etc/udev/hwdb.d/90-custom-keyboard.hwdb and fill it with:

keyboard:usb:v*p*
keyboard:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*
 KEYBOARD_KEY_a0=!mute
 KEYBOARD_KEY_ae=!volumedown
 KEYBOARD_KEY_b0=!volumeup

This is where I fail. `udevadm hwdb --update` does not change any behavior. What do I have to write into the .hwdb file?

I only know the following information about my keyboard:

$ cat /sys/class/input/input0/uevent 
PRODUCT=11/1/1/ab41
NAME="AT Translated Set 2 keyboard"
PHYS="isa0060/serio0/input0"
PROP=0
EV=120013
KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe
MSC=10
LED=7
MODALIAS=input:b0011v0001p0001eAB41-e0,1,4,11,14,k71,72,73,74,75,76,77,79,7A,7B,7C,7D,7E,7F,80,8C,8E,8F,9B,9C,9D,9E,9F,A3,A4,A5,A6,AC,AD,B7,B8,B9,D9,E2,ram4,l0,1,2,sfw

Binding (mapping) Xevents to alsamixer
todo

Unresolved questions

* How do I bind (map) scancodes in .hwdb files for the keyboard used?
* How do I make the udev rules specific to the keyboard in question? Is it possible over PS/2 at all?
* What is dmi (see udev rules for keyboards)?
* Can I help other users of this keyboard by submitting this information somewhere? How do I go about that?

PS: I believe it's the same model as the STREAM XT T2 http://www.cherry.de/cid/keyboards_STREAM_XT_T2.htm and the STREAM XT G85 http://www.cherrycorp.com/english/Keybo … /index.htm

Last edited by qubodup (2013-12-23 20:23:45)

Offline

Board footer

Powered by FluxBB