2

I am trying to build a daemon, preferable using Python, which is able to bind to a special keyboard attached to the Linux machine. The special keyboard is a barcode scanner but has an HID interface.

I would like to avoid running X on the machine, so something low-level like evdev with its python bindings seem appropriate.

My suggestion would be the following:

  1. Use a custom udev rule to generate a character device like /dev/input/barcode0 and fix the permission to allow the daemon to access the device.
  2. Use evdev to get the input.

Is this approach feasible? What happens to the keyboard events? Is it possible to consume them so that they are not passed to a running console on the machine?

I have found a question here on SO with a similar problem, but it is using an X server which I do not.

Community
  • 1
  • 1
GorillaPatch
  • 5,007
  • 1
  • 39
  • 56
  • possible duplicate of [Integrating HID access with evdev on linux with Python twisted](http://stackoverflow.com/questions/28449455/integrating-hid-access-with-evdev-on-linux-with-python-twisted) – GorillaPatch Feb 14 '15 at 16:06

0 Answers0