Groups all input-related methods and objects. Has built-in support for keyboard, multiple gamepads and mouse.
More...
|
enum | Type { Type::KEYBOARD = 0x00u,
Type::XBOXPAD = 0x7Fu,
Type::JOYPAD = 0xFFu
} |
| Represents the current input type on the input system. More...
|
|
enum | ThumbStick { ThumbStick::LEFTSTICK = 0x00u,
ThumbStick::NOSTICK = 0x7Fu,
ThumbStick::RIGHTSTICK = 0xFFu
} |
| Represents one thumbstick on a gamepad. More...
|
|
enum | ThumbStickAxis { ThumbStickAxis::HORIZONTAL = 0x00u,
ThumbStickAxis::NOAXIS = 0x7Fu,
ThumbStickAxis::VERTICAL = 0xFFu
} |
| Represents an axis of a thumbstick. More...
|
|
enum | ThumbStickAxisSignal { ThumbStickAxisSignal::CENTERED = 0x7FFFu,
ThumbStickAxisSignal::POSITIVE = 0xFFFEu,
ThumbStickAxisSignal::NEGATIVE = 0x0000u
} |
| Represents the signal of a thumbstick's axis or a Trigger. More...
|
|
enum | GamePadTrigger { GamePadTrigger::LEFTTRIGGER = 0x00u,
GamePadTrigger::RIGHTTRIGGER = 0xFFu
} |
| Represents a trigger of the gamepad. More...
|
|
enum | GamePadButton {
GamePadButton::START = 0x00u,
GamePadButton::SELECT = 0x01u,
GamePadButton::A = 0x02u,
GamePadButton::B = 0x03u,
GamePadButton::X = 0x04u,
GamePadButton::Y = 0x05u,
GamePadButton::LSTICK = 0x06u,
GamePadButton::RSTICK = 0x07u,
GamePadButton::HAT_UP = 0x08u,
GamePadButton::HAT_DOWN = 0x09u,
GamePadButton::HAT_LEFT = 0x0Au,
GamePadButton::HAT_RIGHT = 0x0Bu,
GamePadButton::LSHOULDER1 = 0x0Cu,
GamePadButton::LSHOULDER2 = 0x0Du,
GamePadButton::RSHOULDER1 = 0x0Eu,
GamePadButton::RSHOULDER2 = 0x0Fu,
GamePadButton::BIGBUTTON = 0x10u
} |
| Represents a button of the gamepad. More...
|
|
enum | MouseButton { MouseButton::LEFTMB = 0x00u,
MouseButton::MIDDLEMB = 0x01u,
MouseButton::RIGHTMB = 0x02u
} |
| Represents a button of the mouse. More...
|
|
|
static void | init () |
| Initializes the Input System and Joysticks, if connected. More...
|
|
static void | dispose () |
| Disposes all Input System and Joysticks. More...
|
|
static void | Update () |
| Updates the system. More...
|
|
static void | SetType (Type t) |
| Sets the type of input for the input system. More...
|
|
static void | Set (GamePadButton btn, bool st) |
| Sets the state of a gamepad button. Also works for keyboard, as key bindings have equivalent gamepad buttons. More...
|
|
static void | SetMouse (MouseButton btn, bool st) |
| Sets the state of a mouse button. More...
|
|
static void | SetKeyboard (ThumbStick thumb, ThumbStickAxis axis, ThumbStickAxisSignal sig) |
| Sets the state of the thumbsticks according to a keyboard key press. More...
|
|
static void | SetJoystick (ThumbStick thumb, ThumbStickAxis axis, word_s sig) |
| Sets the state of the thumbsticks according to a joypad thumbstick move. More...
|
|
static void | SetTrigger (GamePadTrigger trig, word_s pos) |
| Sets the state of a trigger according to a joypad trigger move, if supported. More...
|
|
static void | SetMouse (vec2dw pos) |
| Sets the state of the mouse position. More...
|
|
static void | SetDeadZone (word dz) |
| Sets the thumbsticks' dead zone value. More...
|
|
static bool | PressingButton (GamePadButton btn) |
| Gets if a specific button is being pressed and held down. More...
|
|
static bool | PressedButton (GamePadButton btn) |
| Gets if a specific button was pressed, at the pressing moment. More...
|
|
static bool | PressingMouse (MouseButton btn) |
| Gets if a specific mouse button is being pressed and held down. More...
|
|
static bool | PressedMouse (MouseButton btn) |
| Gets if a specific mouse button was pressed, at the pressing moment. More...
|
|
static Type | GetType () |
| Gets the current type of input being received. More...
|
|
static vec2 | GetLeftStick () |
| Gets the current position of the left thumbstick. More...
|
|
static vec2 | GetRightStick () |
| Gets the current position of the right thumbstick. More...
|
|
static word | GetDeadZone () |
| Gets the current Dead Zone of the thumbsticks. More...
|
|
static float | GetTrigger (GamePadTrigger tr) |
| Gets the current position of a gamepad trigger. More...
|
|
static vec2dw | GetMousePos () |
| Gets the current position of the mouse. More...
|
|
static State | GetState () |
| Gets the current state of input. More...
|
|
static State | GetOldState () |
| Gets the old state of input. More...
|
|
static void | InitJoystick () |
| Tries to initialize a joystick, if there's any connected. More...
|
|
static bool | IsJoystickAvailable () |
| Shows if a joystick is available. More...
|
|
static void | StartJoystickRumbleSupport () |
| Starts the rumble support for the joystick, if available. More...
|
|
static void | StopJoystickRumbleSupport () |
| Stops the rumble support for the joystick, if active. More...
|
|
static bool | IsJoystickRumbleSupported () |
| Gets the rumble support for the joystick. More...
|
|
static void | Rumble (float strength, dword duration) |
| Rumbles the joystick, if the rumble support is active. More...
|
|
static bool | IsXboxController () |
| Checks if the currently attached joystick is an Xbox Controller. More...
|
|
static void | CallExitCommand () |
| Calls the exit command input, setting the Exit flag to true. More...
|
|
static bool | IsExitFlagActive () |
| Checks if the exit flag has been activated. More...
|
|
static void | ShowMouse () |
| Shows mouse pointer, if hidden. More...
|
|
static void | HideMouse () |
| Hides mouse pointer, if visible. More...
|
|
static void | BindKey (SDL_Keycode key, GamePadButton btn) |
| Binds a keyboard key to a gamepad button. More...
|
|
static void | UnbindKey (SDL_Keycode key) |
| Unbinds a keyboard key to a gamepad button. More...
|
|
static void | BindStick (SDL_Keycode key, ThumbStick stick, ThumbStickAxis axis, ThumbStickAxisSignal signal) |
| Binds a keyboard key to a gamepad thumbstick movement. More...
|
|
static void | UnbindStick (ThumbStick stick, ThumbStickAxis axis, ThumbStickAxisSignal signal) |
| Unbinds a keyboard key to a gamepad thumbstick movement. If the key is not binded, nothing happens. More...
|
|
static void | BindDefaultKeys () |
| Binds default keyboard keys to the application.
Here's the equivalency table for the default bindings. More...
|
|
static bool | PressingKey (SDL_Scancode code) |
| Gets if a keyboard key is being pressed. More...
|
|
static bool | PressedKey (SDL_Scancode code) |
| Gets if a keyboard key was pressed. More...
|
|
static bool | MovedStick (ThumbStick thumbstick, ThumbStickAxis axis, ThumbStickAxisSignal signal) |
| Gets if a thumbstick was moved to a given direction (current frame only). More...
|
|
static std::string | GetInputDeviceName () |
| Gets the current input device name. More...
|
|
Groups all input-related methods and objects. Has built-in support for keyboard, multiple gamepads and mouse.