Dgame.System.Joystick
« Go back
Bottom- struct Joystick;
- Represent a Joystick
Author:
Randy Schuett (rswhite4@googlemail.com)
- enum Hat: ubyte;
- The supported Hat positions
- nothrow @nogc this(int device);
- CTor
- nothrow @nogc bool isAttached();
- Returns true if the Joystick has been opened, false if not
- nothrow @nogc Vector2i getBallDelta(int ball);
- Returns the delta position of the given Ball index since the last call
- nothrow @nogc bool isPressed(int btn);
- Returns whether the given Button is pressed
- nothrow @nogc short getAxisValue(int axis);
- Returns the value of the given Axis index in range of short.min .. short.max
- nothrow @nogc Hat getHat(int hat);
- Returns the position of the given Hat index
See:
Hat enum
- nothrow @nogc @property int ID();
- Returns the ID of the Joystick
- nothrow @nogc string getName();
- Returns the name of the Joystick
- nothrow @nogc int getNumOfAxes();
- Returns the amount of Axes of this Joystick
- nothrow @nogc int getNumOfBalls();
- Returns the amount of Balls of this Joystick
- nothrow @nogc int getNumOfButtons();
- Returns the amount of Buttons of this Joystick
- nothrow @nogc int getNumOfHats();
- Returns the amount of Hats of this Joystick
- static nothrow @nogc void update();
- Use this function to update the current state of the open joysticks.
This is called automatically by the event loop
- static nothrow @nogc string getNameForIndex(int device);
- Returns the name of the Joystick of the given device
- static nothrow @nogc int count();
- Returns the amount of plugged Joysticks
Page generated by Ddoc.
« Go back