Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2177  / 3 Years ago, mon, may 31, 2021, 12:28:37

Background: I got the Microsoft Natural Ergonomic Keyboard 4000 and several keys are not working at all under Ubuntu such as the F1-F10 keys. I have Ubuntu 14.04.2 LTS running on my machine.



My solution:
I created the file /etc/udev/hwdb.d/61-keyboard-local.hwdb and set up come custom rules:



keyboard:usb:v045ep00db*
KEYBOARD_KEY_0x1008ff27=pageup
KEYBOARD_KEY_0x1008ff26=pagedown
KEYBOARD_KEY_0xff6a=F1
KEYBOARD_KEY_0x1008ff6b=F5


I got the hex code through xev. For instance, for the key which should be the F1 key, xev returns



KeyRelease event, serial 37, synthetic NO, window 0x4400001,
root 0xa2, subw 0x0, time 1746028, (12,-12), root:(61,40),
state 0x10, keycode 146 (keysym 0xff6a, Help), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False


After changing the file, I ran udevadm hwdb --update and udevadm trigger and, additionally, restarted my laptop.



Issue: The corresponding functionality is not assigned to the respective keys.


More From » keyboard

 Answers
5

  • That one from xev is the key symbol keysym, here the idea:



    /keyboard/ → scancode → /input driver/ → keycode → /X server XKB/ → keysym



    man xev says: xev - print contents of X events


  • So, what you are looking for is the early hardware data from keyboard which is the scancode. It can be found using evtest



    man evtest evtest - Input device event monitor and query tool




    1. Install it



      sudo apt-get install evtest

    2. Run



      sudo evtest


      Output



      Event: time 1435906588.943349, type 4 (EV_MSC), code 4 (MSC_SCAN), value 3b
      Event: time 1435906588.943349, type 1 (EV_KEY), code 59 (KEY_F1), value 1


      Scancode is 3b




[#19864] Tuesday, June 1, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alkeake

Total Points: 467
Total Questions: 94
Total Answers: 126

Location: Tajikistan
Member since Tue, Jun 15, 2021
3 Years ago
alkeake questions
Mon, Jul 5, 21, 09:24, 3 Years ago
Sun, Apr 23, 23, 03:29, 1 Year ago
Thu, Dec 22, 22, 20:30, 1 Year ago
;