Ask Your Question
0

Custom keymap with systemd

asked 2014-01-20 03:23:48 -0500

sim3213 gravatar image

I have got a similar problem, with an UNICOMP 122 Terminal-Keyboard (set to send terminal-scancodes), however Ahmad`s solution/explanation (ask.fedoraproject.org/answers/39395/) does not seem to work... (-> meaning i have replugged the keyboard, and even rebooted the whole machine a couple times, and still ended up with esc getting mapped as . )

my /etc/udev/hwdb.d/70-keyboard-custom.hwdb:

###########################################################
# Unicomp
###########################################################
#keyboard:dmi:bvn*:bvr*:bd*:svnSystemmanufacturer:pnSystemProductName:pvr*
keyboard:dmi:bvnAmericanMegatrendsInc.:bvr2201:bd01/16/2012:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnF1A75-VPRO:rvrRevX.0x:cvnChassisManufacture:ct3:cvrChassisVersion:
KEYBOARD_KEY_7e=esc
KEYBOARD_KEY_75=menu
KEYBOARD_KEY_6c=context_menu
KEYBOARD_KEY_72=sysrq
KEYBOARD_KEY_5a=screenlock
KEYBOARD_KEY_cf=enter
KEYBOARD_KEY_d1=pageup
KEYBOARD_KEY_d3=pagedown
KEYBOARD_KEY_c9=insert
KEYBOARD_KEY_d2=delete
KEYBOARD_KEY_01=end
KEYBOARD_KEY_37=kpslash
KEYBOARD_KEY_b5=kpasterisk
KEYBOARD_KEY_4e=kpminus
KEYBOARD_KEY_4a=kpplus
KEYBOARD_KEY_5b=f13
KEYBOARD_KEY_5c=f14
KEYBOARD_KEY_5d=f15
KEYBOARD_KEY_63=f16
KEYBOARD_KEY_64=f17
KEYBOARD_KEY_65=f18
KEYBOARD_KEY_66=f19
KEYBOARD_KEY_67=f20
KEYBOARD_KEY_68=f21
KEYBOARD_KEY_69=f22
KEYBOARD_KEY_6a=f23
KEYBOARD_KEY_6b=f24
KEYBOARD_KEY_6f=playpause
KEYBOARD_KEY_74=previoussong
KEYBOARD_KEY_6d=nextsong

I have used the scancodes and keys that had worked under the old udev, since I was unable to find an updated list...

This is how i got the devID: (note that unicomp does not seem to care about writing their names onto their chips;)

find /sys -name modalias -print0 | xargs -0 cat | sort -u
...
dmi:bvnAmericanMegatrendsInc.:bvr2201:bd01/16/2012:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnF1A75-VPRO:rvrRevX.0x:cvnChassisManufacture:ct3:cvrChassisVersion:
hid:b0003g0001v000009DAp00009090
input:b0000v0000p0000e0000-e0,5,kramlsfw2,
input:b0000v0000p0000e0000-e0,5,kramlsfw4,
input:b0000v0000p0000e0000-e0,5,kramlsfw6,
input:b0000v0000p0000e0000-e0,5,kramlsfw6,8,
input:b0000v0000p0000e0000-e0,5,kramlsfwD,
...

As far as i am concerned, the file had no spelling mistakes in it, since the DB-Update seems to have worked..

$ sudo udevadm hwdb --update
[sudo] password for $user: 
$

Anyone got an idea what i am doing wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-01-20 08:31:11 -0500

Ahmad Samir gravatar image

I am not sure this rule is correct, (AmericanMegatrendsInc is probably the BIOS manufacturer, not the keyboard).

As root run evtest, it'll print a list of the input devices, pick number corresponding to your keyboard.

From the above if it's e.g. /dev/input/event2, look at the output of:

udevadm info /sys/class/input/event2

to get a list of the hw data about the keyboard. Then you can use that info in the custom .hwdb file you created.

Note that you can use this to match all the keyboards connected to the system (as a test to see if it works, then you can specify the VENDOR_ID ... etc for that particular keyboard):

keyboard:usb:v*p*
edit flag offensive delete link more

Comments

Thanks! I found the (main) problem was, that i had no SPACE before the KEYBOARD_KEY* entrys. adding this made things a lot better :)

sim3213 gravatar imagesim3213 ( 2014-01-20 13:39:20 -0500 )edit

I can confirm that the .hwdb rule files are indentation-sensitive, removing the space before any of the KEYBOARD_KEY entries makes it ignored.

Ahmad Samir gravatar imageAhmad Samir ( 2014-01-24 01:00:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-01-20 03:23:48 -0500

Seen: 677 times

Last updated: Jan 20 '14