GameController

Represent a Game Controller

Constructors

this
this(int device)

CTor

Destructor

~this
~this()

DTor

Postblit

this(this)
@disable this(this)

Postblit is disabled

Copying this object is disabled.

Members

Enums

Axis
enum Axis

Supported Game Controller Axis

Button
enum Button

Supported Game Controller Buttons

Functions

getAxisValue
short getAxisValue(Axis axis)

Returns the value of the given Axis. The value is in range of short.min .. short.max

getJoystick
Joystick getJoystick()

Returns the Joystick interface of the GameController

getMapping
string getMapping()

Returns the mapping of the GameController

getName
string getName()

Returns the name of the GameController

isAttached
bool isAttached()

Returns if the GameController has been opened and is currently connected.

isPressed
bool isPressed(Button btn)

Returns whether the given Button is pressed

Static functions

getNameForIndex
string getNameForIndex(int device)

Returns the name of the GameController of the given device

isGameController
bool isGameController(int device)

Returns if the given device (e.g. a Joystick) is supported by the GameController interface.

update
void update()

Use this function to update the current state of the open GameController. This function is called automatically by the event loop

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)