Input¶
Generated
This page is auto-generated from psxsplash-main/src/luaapi.hh by scripts/py/gen_lua_api_docs.py. Edits won't survive the next build — fix the source comments instead.
4 entries, 2 with worked examples mined from godot-ps1/demo/scripts/ and the bundled templates.
Methods¶
Input.IsPressed(button) -> boolean¶
True only on the frame the button was pressed
Example
-- would put this behind an Options menu + persisted preference.
if Input.IsPressed(Input.SELECT) then
Source: godot-ps1/demo/scripts/test_logger.lua line 215.
Input.IsReleased(button) -> boolean¶
True only on the frame the button was released
Input.IsHeld(button) -> boolean¶
True while the button is held down
Input.GetAnalog(stick) -> x, y¶
Returns analog stick values for the requested stick.
stick accepts the named constants Input.LEFT_STICK (0,
default) or Input.RIGHT_STICK (1). x and y are
FixedPoint<12> in the range [-1.0, 1.0]; multiply by your
sensitivity factor before applying to camera/movement state.
Common pattern (twin-stick camera):
local rx, ry = Input.GetAnalog(Input.RIGHT_STICK)
Camera.SetH(Camera.GetH() + rx / 8)
Example
-- Direction: left stick if held; otherwise backstep from facing.
local lx, ly = Input.GetAnalog(Input.LEFT_STICK)
Source: godot-ps1/demo/scripts/boss_smoke_player.lua line 65.