| 1 |
|
| 2 |
This is a small collection of input layer utilities. I wrote them |
| 3 |
mainly for testing and debugging, but maybe others find them useful |
| 4 |
too :-) |
| 5 |
|
| 6 |
|
| 7 |
lsinput |
| 8 |
======= |
| 9 |
|
| 10 |
probe and list all devices |
| 11 |
|
| 12 |
|
| 13 |
input-event |
| 14 |
=========== |
| 15 |
|
| 16 |
listen for events and print them. Expects a device number as argument |
| 17 |
(0 == /dev/input/event0, ...). |
| 18 |
|
| 19 |
-t <sec> set timeout, quits after <sec> seconds without input. |
| 20 |
default is 10 |
| 21 |
-g grab device using EVIOCGRAB, i.e. get exclusive access to |
| 22 |
the device |
| 23 |
|
| 24 |
|
| 25 |
input-kbd |
| 26 |
========= |
| 27 |
|
| 28 |
read/write keyboard maps (scancode => linux keycode). Also expects a |
| 29 |
device number as argument. |
| 30 |
|
| 31 |
If the input device supports maps, it will print them to stdout. |
| 32 |
Looks like this (AT Keyboard): |
| 33 |
|
| 34 |
0x0001 = 67 # KEY_F9 |
| 35 |
0x0002 = 65 # KEY_F7 |
| 36 |
0x0003 = 63 # KEY_F5 |
| 37 |
0x0004 = 61 # KEY_F3 |
| 38 |
[ ... ] |
| 39 |
|
| 40 |
If the device doesn't support maps the utility just prints the keys |
| 41 |
and/or buttons supported by the device (my mouse): |
| 42 |
|
| 43 |
bits: BTN_LEFT |
| 44 |
bits: BTN_RIGHT |
| 45 |
bits: BTN_MIDDLE |
| 46 |
|
| 47 |
If you pass a map file via -f switch the utility will parse it and |
| 48 |
reconfigure the device. Syntax is identical to the maps printed out, |
| 49 |
i.e. you can dump the current map to some file, edit it and then apply |
| 50 |
the changes. The key names are also accepted, i.e. both this ... |
| 51 |
|
| 52 |
0x0001 = 67 |
| 53 |
|
| 54 |
... and this ... |
| 55 |
|
| 56 |
0x0001 = KEY_F9 |
| 57 |
|
| 58 |
... works. |
| 59 |
|
| 60 |
|
| 61 |
input-send |
| 62 |
========== |
| 63 |
|
| 64 |
small daemon which reads from a input device and sends it over the |
| 65 |
network to everyone who connects. Listens on tcp port 1234. |
| 66 |
|
| 67 |
|
| 68 |
input-recv |
| 69 |
========== |
| 70 |
|
| 71 |
the receiving end for the send utility. Connects to localhost:1234 |
| 72 |
right now and prints stuff to stderr. Plan is to put events into |
| 73 |
/dev/input/uinput some day which basically gives you a remote input |
| 74 |
device. |
| 75 |
|
| 76 |
|
| 77 |
Have fun, |
| 78 |
|
| 79 |
Gerd |
| 80 |
|
| 81 |
-- |
| 82 |
Gerd Hoffmann <[email protected]> |