HID input driver

Sample config.json:

"input":
   [{
     "driver":"hid",
     "kwargs":
      {
       "name":"HID 04d9:1603"
      }
   }]

To get device names, you can just run python input/driver/hid.py while your device is connected. It will output available device names.

class input.drivers.hid.InputDevice(path=None, name=None, **kwargs)[source]

A driver for HID devices. As for now, supports keyboards and numpads.

__init__(path=None, name=None, **kwargs)[source]

Initialises the InputDevice object.

Kwargs:

  • path: path to the input device. If not specified, you need to specify name.

  • name: input device name

property status_available

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

set_available_keys()[source]

A simple i.available_keys-setting code that assumes the driver’s mapping is a plain list of key names. If it’s not so, the driver needs to override the set_available_keys method to properly generate the available_keys list.

runner()[source]

Blocking event loop which just calls supplied callbacks in the keymap.