File: ucimf_keyboard

package info (click to toggle)
libucimf 2.3.7-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,912 kB
  • ctags: 708
  • sloc: sh: 10,568; cpp: 3,769; ansic: 789; makefile: 63
file content (20 lines) | stat: -rwxr-xr-x 695 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# keys definition are in /usr/include/linux/input.h

SPACE=$(grep KEY_SPACE /usr/include/linux/input.h | sed -e 's/#define[[:blank:]]KEY_SPACE[[:blank:]]*\([[:digit:]]*\)/\1/g' )
LEFTSHIFT=$(grep KEY_LEFTSHIFT /usr/include/linux/input.h | sed -e 's/#define[[:blank:]]KEY_LEFTSHIFT[[:blank:]]*\([[:digit:]]*\)/\1/g' )
RIGHTSHIFT=$(grep KEY_RIGHTSHIFT /usr/include/linux/input.h | sed -e 's/#define[[:blank:]]KEY_RIGHTSHIFT[[:blank:]]*\([[:digit:]]*\)/\1/g' )

if [ -n "$SPACE" -a -n " $LEFTSHIFT" -a -n "$RIGHTSHIFT" ]; then

loadkeys  << EOF
control keycode $SPACE = F12
control keycode $LEFTSHIFT = F10
control keycode $RIGHTSHIFT = F11
EOF

else

echo "Cannot find defined keys"

fi