I am trying to capture linux keyboard/mouse input, and I am reading events from like /dev/input/event2
. But it seems the input are sometimes directed to /dev/input/event2
, sometimes to /dev/input/event3
. I wonder if there is a place I can find out which of the stream has the input?
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Stop child process when parent process stops
- Fire resize event once not based on timing
- Error building gcc 4.8.3 from source: libstdc++.so
To find out, go to
/dev/input/by-id
or/dev/input/by-path
and do als -l
to find out which symlink points to whichevent<*>
.Also, I thought it would be helpful for all those who come across this page to find this helpful link to some code which captures keyboard events.
Using evtest is very helpful. It can list all your input devices by name, and allows you to monitor each device's events.
Run this in Terminal, it will work just fine:
Source
Just stumbled across this -- rather late in the day.
You can find out the names and other attributes of different devices using: