Manette.Device

g GObject.Object GObject.Object Manette.Device Manette.Device GObject.Object->Manette.Device

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_name ()

has_input (type, code)

has_rumble ()

has_user_mapping ()

remove_user_mapping ()

rumble (strong_magnitude, weak_magnitude, milliseconds)

save_user_mapping (mapping_string)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

absolute-axis-event

Emitted when an absolute axis’ value changes.

button-press-event

Emitted when a button is pressed.

button-release-event

Emitted when a button is released.

disconnected

Emitted when the device is disconnected.

event

Emitted for any kind of event before mapping it.

hat-axis-event

Emitted when a hat axis’ value changes.

Fields

Inherited:

GObject.Object (1)

Class Details

class Manette.Device(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Manette.DeviceClass

get_name()
Returns:

the name of self, do not modify it or free it

Return type:

str

Gets the device’s name.

has_input(type, code)
Parameters:
  • type (int) – the input type

  • code (int) – the input code

Returns:

whether the device has the given input

Return type:

bool

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:

bool

Gets whether self supports rumble.

has_user_mapping()
Returns:

whether self has a user mapping

Return type:

bool

Gets whether self has a user mapping.

remove_user_mapping()

Removes the user mapping for self.

rumble(strong_magnitude, weak_magnitude, milliseconds)
Parameters:
  • strong_magnitude (int) – the magnitude for the heavy motor

  • weak_magnitude (int) – the magnitude for the light motor

  • milliseconds (int) – the rumble effect play time in milliseconds

Returns:

whether the rumble effect was played

Return type:

bool

Make self rumble during milliseconds milliseconds, with the heavy and light motors rumbling at their respectively defined magnitudes.

The duration cannot exceed 32767 milliseconds.

save_user_mapping(mapping_string)
Parameters:

mapping_string (str) – the mapping string

Saves mapping_string as the user mapping for self.

Signal Details

Manette.Device.signals.absolute_axis_event(device, event)
Signal Name:

absolute-axis-event

Flags:

RUN_LAST

Parameters:

Emitted when an absolute axis’ value changes.

Manette.Device.signals.button_press_event(device, event)
Signal Name:

button-press-event

Flags:

RUN_LAST

Parameters:

Emitted when a button is pressed.

Manette.Device.signals.button_release_event(device, event)
Signal Name:

button-release-event

Flags:

RUN_LAST

Parameters:

Emitted when a button is released.

Manette.Device.signals.disconnected(device)
Signal Name:

disconnected

Flags:

RUN_LAST

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:

RUN_LAST

Parameters:

Emitted for any kind of event before mapping it.

Manette.Device.signals.hat_axis_event(device, event)
Signal Name:

hat-axis-event

Flags:

RUN_LAST

Parameters:

Emitted when a hat axis’ value changes.