summaryrefslogtreecommitdiff
path: root/src/extras/keymap/keyboard-force-release.sh.in
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2012-01-05 22:41:45 +0100
committerKay Sievers <kay.sievers@vrfy.org>2012-01-06 05:07:10 +0100
commitad29a9f14fa8b1932c0e418bfcf1c10ce6a35a33 (patch)
tree9212c3d9d937234c25d19b993664b8ed164869a5 /src/extras/keymap/keyboard-force-release.sh.in
parent9fbe27d9d6dc6e4530ce904d35c74326e415e34e (diff)
merge udev/, libudev/, systemd/ files in src/; move extras/ to src/
Diffstat (limited to 'src/extras/keymap/keyboard-force-release.sh.in')
-rwxr-xr-xsrc/extras/keymap/keyboard-force-release.sh.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/extras/keymap/keyboard-force-release.sh.in b/src/extras/keymap/keyboard-force-release.sh.in
new file mode 100755
index 0000000000..154be3d733
--- /dev/null
+++ b/src/extras/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"