Manette.Device¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when an absolute axis’ value changes. |
|
Emitted when a button is pressed. |
|
Emitted when a button is released. |
|
Emitted when the device is disconnected. |
|
Emitted for any kind of event before mapping it. |
|
Emitted when a hat axis’ value changes. |
Fields¶
- Inherited:
Class Details¶
- class Manette.Device(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An object representing a physical gamepad.
See also: [class`Monitor`].
- get_device_type()¶
- Returns:
the device type
- Return type:
Gets the device type of self.
New in version 0.2.10.
- get_guid()¶
- Returns:
the identifier used by SDL mappings
- Return type:
Gets the identifier used by SDL mappings to discriminate game controller devices.
New in version 0.2.10.
- get_mapping()¶
-
Gets the user mapping for self, or default mapping if there isn’t any.
Can return
NULL
if there’s no mapping or self doesn’t support mappings.New in version 0.2.10.
- has_input(type, code)¶
- Parameters:
- Returns:
whether the device has the given input
- Return type:
Gets whether the device has the given input.
If the input is present, it means that the device can send events for it regardless of whether the device is mapped or not.
- has_rumble()¶
- Returns:
whether self supports rumble
- Return type:
Gets whether self supports rumble.
- has_user_mapping()¶
- Returns:
whether self has a user mapping
- Return type:
Gets whether self has a user mapping.
- remove_user_mapping()¶
Removes the user mapping for self.
- rumble(strong_magnitude, weak_magnitude, milliseconds)¶
- Parameters:
- Returns:
whether the rumble effect was played
- Return type:
Make self rumble during milliseconds milliseconds.
The heavy and light motors will rumble at their respectively defined magnitudes.
The duration cannot exceed 32767 milliseconds.
Signal Details¶
- Manette.Device.signals.absolute_axis_event(device, event)¶
- Signal Name:
absolute-axis-event
- Flags:
- Parameters:
device (
Manette.Device
) – The object which received the signalevent (
Manette.Event
) – the event emitted by the manette device
Emitted when an absolute axis’ value changes.
- Manette.Device.signals.button_press_event(device, event)¶
- Signal Name:
button-press-event
- Flags:
- Parameters:
device (
Manette.Device
) – The object which received the signalevent (
Manette.Event
) – the event emitted by the device
Emitted when a button is pressed.
- Manette.Device.signals.button_release_event(device, event)¶
- Signal Name:
button-release-event
- Flags:
- Parameters:
device (
Manette.Device
) – The object which received the signalevent (
Manette.Event
) – the event emitted by the device
Emitted when a button is released.
- Manette.Device.signals.disconnected(device)¶
- Signal Name:
disconnected
- Flags:
- Parameters:
device (
Manette.Device
) – The object which received the signal
Emitted when the device is disconnected.
- Manette.Device.signals.event(device, event)¶
- Signal Name:
event
- Flags:
- Parameters:
device (
Manette.Device
) – The object which received the signalevent (
Manette.Event
) – the event emitted by the device
Emitted for any kind of event before mapping it.
- Manette.Device.signals.hat_axis_event(device, event)¶
- Signal Name:
hat-axis-event
- Flags:
- Parameters:
device (
Manette.Device
) – The object which received the signalevent (
Manette.Event
) – the event emitted by the manette device
Emitted when a hat axis’ value changes.