1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
systemd/extras/keymap/keyboard-force-release.sh
Johannes Stezenbach 8350d0b9ec 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>
2009-12-14 19:19:35 +01:00

23 lines
502 B
Bash

#!/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"