snegg.ei module
Wrapper module around the libei
C library. This is a thin API wrapper with
most of the semantics of the underlying C library preserved.
See the libei documentation
for details on each API.
Warning
Most objects in this module are refcounted and automatically destroy the underlying C object when the Python reference is dropped. This may cause all sub-objects in the underlying C object to be destroyed as well. Care must be taken to preserve the Python object across multiple invocations.
- class snegg.ei.Context(cobject)
Bases:
CObjectWrapper
Represents a libei context. Use
Sender
orReceiver
to create a context.Logging of the libei context is hooked into Python’s
logging
module as theei
logger.Warning
This context is refcounted and automatically destroys the underlying C object when the reference is dropped. This may cause all sub-objects in the underlying C object to be destroyed.
- class snegg.ei.Device(cobj)
Bases:
CObjectWrapper
- property capabilities: tuple[snegg.ei.DeviceCapability]
- close()
- property device_type: DeviceType
- property regions: tuple[snegg.ei.Region]
- class snegg.ei.DeviceCapability(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntFlag
- BUTTON = 32
- KEYBOARD = 4
- POINTER = 1
- POINTER_ABSOLUTE = 2
- SCROLL = 16
- TOUCH = 8
- class snegg.ei.DeviceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnum
- PHYSICAL = 2
- VIRTUAL = 1
- class snegg.ei.Event(cobj)
Bases:
CObjectWrapper
- property button_event: ButtonEvent
- property keyboard_xkb_modifiers: XkbModifiersEvent
- property pointer_absolute_event: PointerAbsoluteEvent
- property pointer_event: PointerEvent
- property scroll_discrete_event: ScrollDiscreteEvent
- property scroll_event: ScrollEvent
- property scroll_stop_event: ScrollStopEvent
- property touch_event: TouchEvent
- class snegg.ei.EventType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnum
- BUTTON_BUTTON = 500
- CONNECT = 1
- DEVICE_ADDED = 5
- DEVICE_PAUSED = 7
- DEVICE_REMOVED = 6
- DEVICE_RESUMED = 8
- DEVICE_START_EMULATING = 200
- DEVICE_STOP_EMULATING = 201
- DISCONNECT = 2
- FRAME = 100
- KEYBOARD_KEY = 700
- KEYBOARD_MODIFIERS = 9
- POINTER_MOTION = 300
- POINTER_MOTION_ABSOLUTE = 400
- SCROLL_CANCEL = 602
- SCROLL_DELTA = 600
- SCROLL_DISCRETE = 603
- SCROLL_STOP = 601
- SEAT_ADDED = 3
- SEAT_REMOVED = 4
- TOUCH_DOWN = 800
- TOUCH_MOTION = 802
- TOUCH_UP = 801
- class snegg.ei.Keymap(cobj)
Bases:
CObjectWrapper
- property keymap_type: KeymapType
- class snegg.ei.KeymapType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnum
- XKB = 1
- class snegg.ei.Region(cobj)
Bases:
CObjectWrapper
- class snegg.ei.Seat(cobj)
Bases:
CObjectWrapper
- bind(capabilities: tuple[snegg.ei.DeviceCapability])
- property capabilities: tuple[snegg.ei.DeviceCapability, ...]
- unbind(capabilities: tuple[snegg.ei.DeviceCapability])
- class snegg.ei.Touch(cobj)
Bases:
CObjectWrapper