diff options
Diffstat (limited to 'extras/keymap/keyboard-force-release.sh.in')
-rw-r--r-- | extras/keymap/keyboard-force-release.sh.in | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/extras/keymap/keyboard-force-release.sh.in b/extras/keymap/keyboard-force-release.sh.in new file mode 100644 index 0000000000..05dd5da2e0 --- /dev/null +++ b/extras/keymap/keyboard-force-release.sh.in @@ -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="@libexecdir@/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" |