pylablib.devices.Windows package
Submodules
pylablib.devices.Windows.joystick module
- class pylablib.devices.Windows.joystick.TDeviceInfo(name, id, nbuttons, naxes)
Bases:
tuple- id
- name
- naxes
- nbuttons
- class pylablib.devices.Windows.joystick.TJoystickEvent(kind, index, old, new, timestamp)
Bases:
tuple- index
- kind
- new
- old
- timestamp
- class pylablib.devices.Windows.joystick.TJoystickEventEx(kind, index, old, new, state, timestamp)
Bases:
tuple- index
- kind
- new
- old
- state
- timestamp
- class pylablib.devices.Windows.joystick.Joystick(idx=None, expanded_events=False)[source]
Bases:
IDeviceGeneric Windows joystick device.
- Parameters:
idx – joystick index (0-based) in the list returned by
list_joysticks(); ifNone, use the first valid index.expanded_events (bool) – if
True, the events include the full joystick state; otherwise, they only record the change of the state at the particular event
- Error = <Mock name='mock.WinMMError' id='133174544966288'>
- get_events(n=None, clear=True)[source]
Get recent joystick events.
Note that in order to capture events, one needs to call the
startmethod first to start the event loop. n specifies the number of oldest uncleared events to get (by default, all events). Ifclear==True, remove all returned events from the queue.
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}of the device available settings. Non-applicable settings are ignored.
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"(all available variables). Since the lowest priority is -10, settinginclude=-10queries all available variables, which is equivalent toinclude="all".
- get_full_status(include=0)
Get dict
{name: value}containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"(all available variables). Since the lowest priority is -10, settinginclude=-10queries all available variables, which is equivalent toinclude="all".
- get_settings(include=0)
Get dict
{name: value}containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"(all available variables). Since the lowest priority is -10, settinginclude=-10queries all available variables, which is equivalent toinclude="all".
- set_device_variable(key, value)
Set the value of a settings parameter