chiark / gitweb /
keymap: handle atkbd force_release quirk
[elogind.git] / extras / keymap / keyboard-force-release.sh
1 #!/bin/sh -e
2 # read list of scancodes, convert hex to decimal and
3 # append to the atkbd force_release sysfs attribute
4 # $1 sysfs devpath for serioX
5 # $2 file with scancode list (hex or dec)
6
7 case "$2" in
8         /*) scf="$2" ;;
9         *)  scf="/lib/udev/keymaps/force-release/$2" ;;
10 esac
11
12 read attr <"/sys/$1/force_release"
13 while read scancode dummy; do
14         case "$scancode" in
15                 \#*) ;;
16                 *)
17                         scancode=$(($scancode))
18                         attr="$attr${attr:+,}$scancode"
19                         ;;
20         esac
21 done <"$scf"
22 echo "$attr" >"/sys/$1/force_release"