summaryrefslogtreecommitdiff
path: root/src/udev/keymap/keyboard-force-release.sh.in
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2012-04-03 21:24:46 +0200
committerKay Sievers <kay.sievers@vrfy.org>2012-04-04 05:05:07 +0200
commit3e2147858f21943d5f4a781c60f33ac22c6096ed (patch)
treecaf12dcef379e98278f7d67a816e0f2069c8fd87 /src/udev/keymap/keyboard-force-release.sh.in
parent19c5f19d69bb5f520fa7213239490c55de06d99d (diff)
move imported udev into place
Diffstat (limited to 'src/udev/keymap/keyboard-force-release.sh.in')
-rwxr-xr-xsrc/udev/keymap/keyboard-force-release.sh.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/udev/keymap/keyboard-force-release.sh.in b/src/udev/keymap/keyboard-force-release.sh.in
new file mode 100755
index 0000000000..dd040cebc3
--- /dev/null
+++ b/src/udev/keymap/keyboard-force-release.sh.in
@@ -0,0 +1,22 @@
+#!@rootprefix@/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="@pkglibexecdir@/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"