Gamepad
Handles the input of the gamepads.
- Version: v1.0.0
- Available since: LIKO-12 v0.6.0
- Last updated in: LIKO-12 v0.8.0
Methods:
Gamepad._CancelMapping
Erases mapping state.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.6.0
Gamepad._CancelMapping()
Gamepad._GetGUID
Sets mapping state to GUID.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.6.0
Gamepad._GetGUID()
Gamepad._MapButton
Sets mapping state to MapButton.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.6.0
Gamepad._MapButton()
Gamepad._SaveMap
Saves mapping to 'Miscellaneous/GamepadMapping.txt'.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.6.0
Gamepad._SaveMap()
Events:
Please note that the example functions won't be called automatically, there must be some kind of an events handler for CPU.pullEvent, check if the LIKO-12 OS you're using has one.
gamepadaxis
Triggered when the joystick is moved.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _gamepadaxis(joystick, axis)
--Content run when the event is triggered
end
Arguments:
- joystick (table): The joystick that was moved.
- axis (string): The axis is was pushed on (leftx or lefty).
gamepadpressed
A button on the gamepad was pressed.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _gamepadpressed(joystick, button)
--Content run when the event is triggered
end
Arguments:
- joystick (table): The joystick with the pressed button.
- button (string): The name of the pressed button.
gamepadreleased
A button on the gamepad was released.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _gamepadreleased(joystick, button)
--Content run when the event is triggered
end
Arguments:
- joystick (table): The joystick with the released button.
- button (string): The name of the released button.
joystickadded
Triggered when a joystick is connected.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _joystickadded(joystick)
--Content run when the event is triggered
end
Arguments:
- joystick (table): The joystick that was added.
joystickaxis
Map the joystick movements.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _joystickaxis(joystick, axis, value)
--Content run when the event is triggered
end
Arguments:
- joystick (table): The joystick to map.
- axis (number): The index to map to.
- value (number): Value of the axis.
joystickhat
Map the 8-direction hat movements.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
direction can be: 'd' (down), 'l' (left), 'r' (right), or 'u' (up)
function _joystickhat(joystick, hat, direction)
--Content run when the event is triggered
end
Arguments:
- joystick (table): The joystick to map.
- hat (number): The index to map to.
- direction (string): Direction to map for.
joystickpressed
Map a button on the joysitck.
- Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _joystickpressed(joystick, button)
--Content run when the event is triggered
end
Arguments:
- joystick (table): The joystick with the button.
- button (string): The button to map.