Joystick

Represent a Joystick

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

Hat
enum Hat

The supported Hat positions

Functions

getAxisValue
short getAxisValue(int axis)

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

getBallDelta
Vector2i getBallDelta(int ball)

Returns the delta position of the given Ball index since the last call

getHat
Hat getHat(int hat)

Returns the position of the given Hat index

getName
string getName()

Returns the name of the Joystick

getNumOfAxes
int getNumOfAxes()

Returns the amount of Axes of this Joystick

getNumOfBalls
int getNumOfBalls()

Returns the amount of Balls of this Joystick

getNumOfButtons
int getNumOfButtons()

Returns the amount of Buttons of this Joystick

getNumOfHats
int getNumOfHats()

Returns the amount of Hats of this Joystick

isAttached
bool isAttached()

Returns true if the Joystick has been opened, false if not

isPressed
bool isPressed(int btn)

Returns whether the given Button is pressed

Properties

ID
int ID [@property getter]

Returns the ID of the Joystick

Static functions

count
int count()

Returns the amount of plugged Joysticks

getNameForIndex
string getNameForIndex(int device)

Returns the name of the Joystick of the given device

update
void update()

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

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)