Device Class

Inheritance diagram of Device

class Device(display, name)

Input device.

Variables:
  • display – Display this device is connected to.
  • name – Name of the device, as described by the device firmware.
  • manufacturer – Name of the device manufacturer, or None if the information is not available.

Constructor:

__init__(display, name)

Methods:

close() Close the device.
get_controls() Get a list of controls provided by the device.
open([window, exclusive]) Open the device to begin receiving input from it.

Methods

Device.close()

Close the device.

Device.get_controls()

Get a list of controls provided by the device.

Return type:list of Control
Device.open(window=None, exclusive=False)

Open the device to begin receiving input from it.

Parameters:
  • window (Window) – Optional window to associate with the device. The behaviour of this parameter is device and operating system dependant. It can usually be omitted for most devices.
  • exclusive (bool) – If True the device will be opened exclusively so that no other application can use it. The method will raise DeviceExclusiveException if the device cannot be opened this way (for example, because another application has already opened it).

Table Of Contents

Previous topic

Control Class

Next topic

Joystick Class