User Tools

Site Tools


doc:appunti:linux:sa:remap_keyboard_keys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:remap_keyboard_keys [2021/12/07 11:25] – [ACPI and evemu] niccolodoc:appunti:linux:sa:remap_keyboard_keys [2021/12/07 11:50] (current) – [xmodmap] niccolo
Line 17: Line 17:
 </code> </code>
  
-It is possibile to customize the ACPI events to reassign the brightness keys to plain function keys, but it is not the preferred way (see [[#acpi_and_evemu|ACPI and evemu]]), because it requires to run an additional sofware layer (the acpid daemon) and the execution of slow action scripts.+It is possibile to customize the ACPI events to reassign the brightness keys to plain function keys, but it is not the preferred way (see [[#acpi_and_evemu|ACPI and evemu]]), because it requires to run an additional sofware layer (the acpid daemon) and the execution of slow action scripts. The simplest method is to **[[#customize_events_using_udev_and_hwdb|customize input events using udev and hwdb]]**.
  
 It seems that the LCD (DISPLAYTOGGLE) multimedia function is intercepted by the hardware and it is not handled as an input event nor as an ACPI event by the operating system. It seems that the LCD (DISPLAYTOGGLE) multimedia function is intercepted by the hardware and it is not handled as an input event nor as an ACPI event by the operating system.
Line 181: Line 181:
 ===== Configuration example for the Teclast F6 notebook ===== ===== Configuration example for the Teclast F6 notebook =====
  
-The following is the file **/etc/udev/hwdb.d/90-custom-keyboard.hwdb** which I use on my Teclast F6 notebook:+The following is the file **/etc/udev/hwdb.d/90-teclast-f6-keyboard.hwdb** which I use on my Teclast F6 notebook:
  
 <file> <file>
-# /etc/udev/hwdb.d/90-custom-keyboard.hwdb +# /etc/udev/hwdb.d/90-teclast-f6-keyboard.hwdb 
-#+
 # Keyboard remapping for the Teclast F6 notebook. # Keyboard remapping for the Teclast F6 notebook.
-# 2021-05-13 Niccolo Rigacci <niccolo@rigacci.org>+# 2021-12-07 Niccolo Rigacci <niccolo@rigacci.org>
 # #
 # The following udev hwdb configuration swaps the Fn behaviour # The following udev hwdb configuration swaps the Fn behaviour
-# on keys F2, F3, F4, F8, F9, F10, F11 and F12.+# on keys F2, F3, F4, F6, F7, F8, F9, F10, F11 and F12.
 # It also binds the Fn+ESC to Ctrl+LeftWinLogo+Esc, which can # It also binds the Fn+ESC to Ctrl+LeftWinLogo+Esc, which can
 # be used as keyboard shortcut into XFCE or other desktop # be used as keyboard shortcut into XFCE or other desktop
 # environments to execute a script and toggle the touchpad. # environments to execute a script and toggle the touchpad.
 # #
-# Function keys F1, F6 and F7 cannot be remapped using +# Function key F1 cannot be remapped using udev Hardware 
-udev Hardware Database (as far as I know).+Database (as far as I know).
 # #
-# To make this file effective execute:+# To make this file effective execute (please check the 
 +# input number using lsinput):
 #   systemd-hwdb update #   systemd-hwdb update
 #   udevadm trigger --verbose /dev/input/event0 #   udevadm trigger --verbose /dev/input/event0
 +#   udevadm trigger --verbose /dev/input/event7
 # #
-# To view current binding:+# To view current bindings:
 #   udevadm info /dev/input/event0 #   udevadm info /dev/input/event0
 # #
Line 217: Line 219:
 #   KEYBOARD_KEY_76 => code 85  KEY_ZENKAKUHANKAKU #   KEYBOARD_KEY_76 => code 85  KEY_ZENKAKUHANKAKU
 # #
-Function keys F1, F6 and F7 do not generate events +Fn+F6 and Fn+F7 produce keys 64 and 65 (0x40 and 0x41).
-(verified with evtest and showkey), so they cannot +
-# be remapped. +
-+
-# The following EV_KEY do not work: +
-#   KEY_DISPLAYTOGGLE +
-#   KEY_BRIGHTNESSDOWN +
-#   KEY_BRIGHTNESSUP+
 # #
 +# Function keys F1 does not generate events (verified with
 +# evtest and showkey), so it cannot be remapped.
 +
 +# Teclast AT Keyboard input device.
 evdev:atkbd:dmi:bvnTECLAST:bvr*:bd*:svnTECLAST:pnF6:pvr* evdev:atkbd:dmi:bvnTECLAST:bvr*:bd*:svnTECLAST:pnF6:pvr*
  KEYBOARD_KEY_a0=f2  KEYBOARD_KEY_a0=f2
Line 238: Line 237:
  KEYBOARD_KEY_3d=volumedown  KEYBOARD_KEY_3d=volumedown
  KEYBOARD_KEY_3e=volumeup  KEYBOARD_KEY_3e=volumeup
 + KEYBOARD_KEY_40=brightnessdown
 + KEYBOARD_KEY_41=brightnessup
  KEYBOARD_KEY_42=previoussong  KEYBOARD_KEY_42=previoussong
  KEYBOARD_KEY_43=nextsong  KEYBOARD_KEY_43=nextsong
Line 244: Line 245:
  KEYBOARD_KEY_58=sysrq  KEYBOARD_KEY_58=sysrq
  KEYBOARD_KEY_76=esc  KEYBOARD_KEY_76=esc
 +
 +# F6 and F7 are connected to input "Intel HID events", not keyboard.
 +evdev:name:Intel HID events:dmi:bvnTECLAST:bvr*:bd*:svnTECLAST:pnF6:pvr*
 + KEYBOARD_KEY_14=f6
 + KEYBOARD_KEY_13=f7
 </file> </file>
  
Line 287: Line 293:
 </code> </code>
  
-These keysyms do not produce the expected action; i.e. they don't do anything, despite I associate them to a key and depite that ''evtest'' and ''xev''do report the expected action:+These keysyms do not produce the expected action; i.e. they don't do anything, despite I associate them to a key and despite that ''evtest'' and ''xev''do report the expected action:
  
   * XF86TouchpadToggle, XF86TouchpadOn, XF86TouchpadOff   * XF86TouchpadToggle, XF86TouchpadOn, XF86TouchpadOff
doc/appunti/linux/sa/remap_keyboard_keys.1638872719.txt.gz · Last modified: 2021/12/07 11:25 by niccolo