diff options
author | Johannes Stezenbach <js@sig21.net> | 2009-12-13 23:54:05 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2009-12-14 19:19:35 +0100 |
commit | 8350d0b9ec1f1b47e84549cb1cdd68127ed0e89b (patch) | |
tree | 8ca8434da02e2776ecd925de7958eaa36b3c7acd /extras/keymap | |
parent | 92b8cea053c41315b57439400de9821928445fb3 (diff) |
keymap: handle atkbd force_release quirk
Some laptop keyboards don't generate release events
for some hotkeys. Since linux-2.6.32 the list of scancodes
for which to enable the force_release quirk can be set
via sysfs.
Apply this to Samsung N130.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Diffstat (limited to 'extras/keymap')
-rw-r--r-- | extras/keymap/95-keyboard-force-release.rules | 24 | ||||
-rw-r--r-- | extras/keymap/keyboard-force-release.sh | 22 | ||||
-rw-r--r-- | extras/keymap/keymaps/force-release/samsung-other | 10 |
3 files changed, 56 insertions, 0 deletions
diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules new file mode 100644 index 0000000000..4d0a877044 --- /dev/null +++ b/extras/keymap/95-keyboard-force-release.rules @@ -0,0 +1,24 @@ +# Set model specific atkbd force_release quirk +# +# Several laptops have hotkeys which don't generate release events, +# which can cause problems with software key repeat. +# The atkbd driver has a quirk handler for generating synthetic +# release events, which can be configured via sysfs since 2.6.32. +# Simply add a file with a list of scancodes for your laptop model +# in /lib/udev/keymaps, and add a rule here. +# If the hotkeys also need a keymap assignment you can copy the +# scancodes from the keymap file, otherwise you can run +# /lib/udev/keymap -i /dev/input/eventX +# on a Linux vt to find out. + +ACTION!="add|change", GOTO="force_release_end" +SUBSYSTEM!="serio", GOTO="force_release_end" +KERNEL!="serio*", GOTO="force_release_end" +DRIVER!="atkbd", GOTO="force_release_end" + +ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" + + +ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*", RUN+="keyboard-force-release.sh $devpath samsung-other" + +LABEL="force_release_end" diff --git a/extras/keymap/keyboard-force-release.sh b/extras/keymap/keyboard-force-release.sh new file mode 100644 index 0000000000..b157ac310d --- /dev/null +++ b/extras/keymap/keyboard-force-release.sh @@ -0,0 +1,22 @@ +#!/bin/sh -e +# read list of scancodes, convert hex to decimal and +# append to the atkbd force_release sysfs attribute +# $1 sysfs devpath for serioX +# $2 file with scancode list (hex or dec) + +case "$2" in + /*) scf="$2" ;; + *) scf="/lib/udev/keymaps/force-release/$2" ;; +esac + +read attr <"/sys/$1/force_release" +while read scancode dummy; do + case "$scancode" in + \#*) ;; + *) + scancode=$(($scancode)) + attr="$attr${attr:+,}$scancode" + ;; + esac +done <"$scf" +echo "$attr" >"/sys/$1/force_release" diff --git a/extras/keymap/keymaps/force-release/samsung-other b/extras/keymap/keymaps/force-release/samsung-other new file mode 100644 index 0000000000..c51123a0b6 --- /dev/null +++ b/extras/keymap/keymaps/force-release/samsung-other @@ -0,0 +1,10 @@ +# list of scancodes (hex or decimal), optional comment +0x82 # Fn+F4 CRT/LCD +0x83 # Fn+F2 battery +0x84 # Fn+F5 backlight on/off +0x86 # Fn+F9 WLAN +0x88 # Fn-Up brightness up +0x89 # Fn-Down brightness down +0xB3 # Fn+F8 switch power mode (battery/dynamic/performance) +0xF7 # Fn+F10 Touchpad on +0xF9 # Fn+F10 Touchpad off |