Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of GDWiiInput.

GDWiimoteServer

Inherits: Object

An engine singleton for handling multiple Wiimote controllers.

Description

The GDWiimoteServer object manages Wiimote interactions during the session. It handles connecting, disconnecting, and polling multiple Wiimotes, providing access to their features through the GDWiimote class.

Properties

int

max_wiimotes

4

Methods

void

disconnect_wiimotes()

Array[GDWiimote]

finalize_connection()

Array[GDWiimote]

get_connected_wiimotes() const

void

initialize_connection()

void

poll()

void

start_polling()

void

stop_polling()


Property Descriptions

int max_wiimotes = 4 🔗

  • void set_max_wiimotes(value: int)

  • int get_max_wiimotes()

There is currently no description for this property. Please help us by contributing one!


Method Descriptions

void disconnect_wiimotes() 🔗

Disconnect all currently connected Wiimotes. This will stop any ongoing polling and release resources associated with the Wiimotes.


Array[GDWiimote] finalize_connection() 🔗

Finalize the connection process and return an array of connected GDWiimote instances. This method should be called after connect_wiimotes() to retrieve the connected Wiimotes.

Note: This method is not blocking, so it may be called on the main thread.


Array[GDWiimote] get_connected_wiimotes() const 🔗

Get an array of currently connected GDWiimote instances. This will include all Wiimotes that have been successfully connected and initialized.


void initialize_connection() 🔗

Initiate the connection process for Wiimotes. This method will search for available Wiimotes and connect them, allowing access to their features through the GDWiimote class. This must be followed by a call to finalize_connection() to complete the connection process and retrieve the connected Wiimotes.

Linux: Press 1+2 on each Wiimote after this method is called.

Windows: Pair the Wiimotes through Dolphin emulator or WiiPair before calling this method. Alternatively, you can call this method with the argument true to automatically handle (experimental) pairing mode using WiiPair. However, this does not work consistently and may require several attempts at times. Pairing will be skipped if even one Wiimote is already paired.

Note: This method should be called only once at the start of the session. Subsequent calls will not reinitialize the connection process. This method is also blocking, so it may be prefered to call it in a separate thread.


void poll() 🔗

Manually poll the state of all Wiimotes. This is useful if you want to poll mid-frame or have a custom main loop, as the default polling connects to the scene tree.


void start_polling() 🔗

Start polling the connected Wiimotes for input data. This will enable the Wiimotes to send updates about their state, such as button presses and motion data. Polling is enabled by default.


void stop_polling() 🔗

Stop polling the connected Wiimotes. This will pause the updates from the Wiimotes, preventing any further input data from being processed until polling is restarted with start_polling().