hidtools.util module

class BusType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

The numerical bus type (0x3 for USB, 0x5 for Bluetooth, see

linux/input.h)

BLUETOOTH = 5
HOST = 25
I2C = 24
USB = 3
VIRTUAL = 6
to_twos_comp(val, bits)
twos_comp(val, bits)

compute the 2’s complement of val.

Parameters:
  • val (int) – the value to compute the two’s complement for

  • bits (int) – size of val in bits