0

How to check if keyboard (for examle) is not hanged?

Maybe it is possible to send something to device and check response using pselect()?

I'm using xinput extensions (1,2) do they provide some facility for such a task?

1 Answers1

0

I am currently looking for this. You can get the responding keyboards id by running this in bash.

kbname=$(cat /proc/bus/input/devices |
grep -Poi '(?<=N:\sName=")(.*keyboard.*)(?="$)') &&
xinput list |
grep -Poi '(?<='$kbname')(?:\s+id=\K)(\d+)'
yakupars
  • 26
  • 4
  • Xinput uses XIQueryDevice(...) to get list from /proc/bus/input/devices, so this doesn't help. I've just changed task so my program relies on XIQueryDevice results, and puts all XIMasterKeyboard-type devices in desired array. – Anton Lantcevich Jun 11 '16 at 17:30