Class

WPEPlatformGamepad

Description [src]

abstract class WPEPlatform.Gamepad : GObject.Object
{
  WPEGamepadPrivate* priv
}

A gamepad device.

WPEGamepad is an abstract class that platform implementations derive to represent a connected gamepad. It reports input through the WPEGamepad::button-event and WPEGamepad::axis-event signals, and may support force feedback through wpe_gamepad_rumble().

Gamepads are tracked by a WPEGamepadManager.

Ancestors

Instance methods

wpe_gamepad_axis_event

Emit the signal WPEGamepad::axis-event.

wpe_gamepad_button_event

Emit the signal WPEGamepad::button-event.

wpe_gamepad_get_name

Get the gamepad name.

wpe_gamepad_has_rumble

Checks whether a WPEGamepad has rumble support. Returns TRUE if the gamepad has rumble, FALSE otherwise.

wpe_gamepad_rumble

Attempts to make a WPEGamepad rumble for duration_ms milliseconds. Returns TRUE if the rumble effect was played, FALSE otherwise.

wpe_gamepad_start_input_monitor

Start monitoring input on gamepad. Signals WPEGamepad::button-event and WPEGamepad::axis-event will not be emitted until this function is called.

wpe_gamepad_stop_input_monitor

Stop monitoring input on gamepad. Signals WPEGamepad::button-event and WPEGamepad::axis-event will not be emitted after this function is called.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

WPEPlatform.Gamepad:name

The name of the gamepad.

Signals

WPEPlatform.Gamepad::axis-event

Emitted when value of axis changes.

WPEPlatform.Gamepad::button-event

Emitted when a button is pressed or released.

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct WPEPlatformGamepadClass {
  GObjectClass parent_class;
  void (* start_input_monitor) (
    WPEGamepad* gamepad
  );
  void (* stop_input_monitor) (
    WPEGamepad* gamepad
  );
  gboolean (* has_rumble) (
    WPEGamepad* gamepad
  );
  gboolean (* rumble) (
    WPEGamepad* gamepad,
    gdouble strong_magnitude,
    gdouble weak_magnitude,
    guint duration_ms
  );
  gpointer padding;
  
}

No description available.

Class members
parent_class: GObjectClass

No description available.

start_input_monitor: void (* start_input_monitor) ( WPEGamepad* gamepad )

No description available.

stop_input_monitor: void (* stop_input_monitor) ( WPEGamepad* gamepad )

No description available.

has_rumble: gboolean (* has_rumble) ( WPEGamepad* gamepad )

No description available.

rumble: gboolean (* rumble) ( WPEGamepad* gamepad, gdouble strong_magnitude, gdouble weak_magnitude, guint duration_ms )

No description available.

padding: gpointer

No description available.

Virtual methods

WPEPlatform.GamepadClass.has_rumble

Checks whether a WPEGamepad has rumble support. Returns TRUE if the gamepad has rumble, FALSE otherwise.

WPEPlatform.GamepadClass.rumble

Attempts to make a WPEGamepad rumble for duration_ms milliseconds. Returns TRUE if the rumble effect was played, FALSE otherwise.

WPEPlatform.GamepadClass.start_input_monitor

Start monitoring input on gamepad. Signals WPEGamepad::button-event and WPEGamepad::axis-event will not be emitted until this function is called.

WPEPlatform.GamepadClass.stop_input_monitor

Stop monitoring input on gamepad. Signals WPEGamepad::button-event and WPEGamepad::axis-event will not be emitted after this function is called.