common.controller

Grimoire Copyright (c) 2017 Enalye

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.

Members

Functions

addController
void addController(int index)

Attempt to connect a new controller

destroyControllers
void destroyControllers()

Close all the connected controllers

initializeControllers
void initializeControllers()

Open all the connected controllers

remapController
void remapController(int joystickId)

Called upon remapping

removeController
void removeController(int joystickId)

Remove a connected controller

setControllerAxis
void setControllerAxis(SDL_GameControllerAxis axis, short value)

Change the value of a controller axis.

setControllerButton
void setControllerButton(SDL_GameControllerButton button, bool state)

Change the value of a controller button.

updateControllers
void updateControllers(float deltaTime)

Update the state of the controllers

Properties

inputA
bool inputA [@property getter]

Is the A button pressed.

inputB
bool inputB [@property getter]

Is the B button pressed.

inputDown
bool inputDown [@property getter]

Is the Down button pressed.

inputL1
bool inputL1 [@property getter]

Is the L1 button pressed.

inputL2
bool inputL2 [@property getter]

Is the L2 button pressed.

inputL3
bool inputL3 [@property getter]

Is the L3 button pressed.

inputLAnalog
Vec2f inputLAnalog [@property getter]

Left analog stick

inputLeft
bool inputLeft [@property getter]

Is the Left button pressed.

inputMode
bool inputMode [@property getter]

Is the Mode button pressed.

inputR1
bool inputR1 [@property getter]

Is the R1 button pressed.

inputR2
bool inputR2 [@property getter]

Is the R2 button pressed.

inputR3
bool inputR3 [@property getter]

Is the R3 button pressed.

inputRAnalog
Vec2f inputRAnalog [@property getter]

Right analog stick

inputRight
bool inputRight [@property getter]

Is the Right button pressed.

inputSelect
bool inputSelect [@property getter]

Is the Select button pressed.

inputSingleA
bool inputSingleA [@property getter]

Is the A button pressed. Returns true only if the button was not already tested.

inputSingleB
bool inputSingleB [@property getter]

Is the B button pressed. Returns true only if the button was not already tested.

inputSingleDown
bool inputSingleDown [@property getter]

Is the Down button pressed. Returns true only if the button was not already tested.

inputSingleL1
bool inputSingleL1 [@property getter]

Is the L1 button pressed. Returns true only if the button was not already tested.

inputSingleL2
bool inputSingleL2 [@property getter]

Is the L2 button pressed. Returns true only if the button was not already tested.

inputSingleL3
bool inputSingleL3 [@property getter]

Is the L3 button pressed. Returns true only if the button was not already tested.

inputSingleLeft
bool inputSingleLeft [@property getter]

Is the Left button pressed. Returns true only if the button was not already tested.

inputSingleLeftX
bool inputSingleLeftX [@property getter]

Returns the left stick x-axis as a button.

inputSingleLeftXY
bool inputSingleLeftXY [@property getter]

Returns the left stick x and y axis as a button.

inputSingleLeftY
bool inputSingleLeftY [@property getter]

Returns the left stick y-axis as a button.

inputSingleMode
bool inputSingleMode [@property getter]

Is the Mode button pressed. Returns true only if the button was not already tested.

inputSingleR1
bool inputSingleR1 [@property getter]

Is the R1 button pressed. Returns true only if the button was not already tested.

inputSingleR2
bool inputSingleR2 [@property getter]

Is the R2 button pressed. Returns true only if the button was not already tested.

inputSingleR3
bool inputSingleR3 [@property getter]

Is the R3 button pressed. Returns true only if the button was not already tested.

inputSingleRight
bool inputSingleRight [@property getter]

Is the Right button pressed. Returns true only if the button was not already tested.

inputSingleRightX
bool inputSingleRightX [@property getter]

Returns the right stick x-axis as a button.

inputSingleRightXY
bool inputSingleRightXY [@property getter]

Returns the right stick x and y axis as a button.

inputSingleRightY
bool inputSingleRightY [@property getter]

Returns the right stick y-axis as a button.

inputSingleSelect
bool inputSingleSelect [@property getter]

Is the Select button pressed. Returns true only if the button was not already tested.

inputSingleStart
bool inputSingleStart [@property getter]

Is the Start button pressed. Returns true only if the button was not already tested.

inputSingleUp
bool inputSingleUp [@property getter]

Is the Up button pressed. Returns true only if the button was not already tested.

inputSingleX
bool inputSingleX [@property getter]

Is the X button pressed. Returns true only if the button was not already tested.

inputSingleY
bool inputSingleY [@property getter]

Is the Y button pressed. Returns true only if the button was not already tested.

inputStart
bool inputStart [@property getter]

Is the Start button pressed.

inputUp
bool inputUp [@property getter]

Is the Up button pressed.

inputX
bool inputX [@property getter]

Is the X button pressed.

inputY
bool inputY [@property getter]

Is the Y button pressed.

Meta