77 lines
2.4 KiB
Lua
77 lines
2.4 KiB
Lua
module('input')
|
|
module('platform')
|
|
module('scene')
|
|
module('locale')
|
|
|
|
-- Default Input bindings.
|
|
if PSP then
|
|
inputBind("up", INPUT_ACTION_UP)
|
|
inputBind("down", INPUT_ACTION_DOWN)
|
|
inputBind("left", INPUT_ACTION_LEFT)
|
|
inputBind("right", INPUT_ACTION_RIGHT)
|
|
inputBind("circle", INPUT_ACTION_CANCEL)
|
|
inputBind("cross", INPUT_ACTION_ACCEPT)
|
|
inputBind("select", INPUT_ACTION_RAGEQUIT)
|
|
inputBind("lstick_up", INPUT_ACTION_UP)
|
|
inputBind("lstick_down", INPUT_ACTION_DOWN)
|
|
inputBind("lstick_left", INPUT_ACTION_LEFT)
|
|
inputBind("lstick_right", INPUT_ACTION_RIGHT)
|
|
|
|
elseif DOLPHIN then
|
|
inputBind("up", INPUT_ACTION_UP)
|
|
inputBind("down", INPUT_ACTION_DOWN)
|
|
inputBind("left", INPUT_ACTION_LEFT)
|
|
inputBind("right", INPUT_ACTION_RIGHT)
|
|
inputBind("b", INPUT_ACTION_CANCEL)
|
|
inputBind("a", INPUT_ACTION_ACCEPT)
|
|
inputBind("z", INPUT_ACTION_RAGEQUIT)
|
|
inputBind("lstick_up", INPUT_ACTION_UP)
|
|
inputBind("lstick_down", INPUT_ACTION_DOWN)
|
|
inputBind("lstick_left", INPUT_ACTION_LEFT)
|
|
inputBind("lstick_right", INPUT_ACTION_RIGHT)
|
|
|
|
elseif LINUX then
|
|
if INPUT_KEYBOARD then
|
|
inputBind("w", INPUT_ACTION_UP)
|
|
inputBind("s", INPUT_ACTION_DOWN)
|
|
inputBind("a", INPUT_ACTION_LEFT)
|
|
inputBind("d", INPUT_ACTION_RIGHT)
|
|
|
|
inputBind("left", INPUT_ACTION_LEFT)
|
|
inputBind("right", INPUT_ACTION_RIGHT)
|
|
inputBind("up", INPUT_ACTION_UP)
|
|
inputBind("down", INPUT_ACTION_DOWN)
|
|
|
|
inputBind("enter", INPUT_ACTION_ACCEPT)
|
|
inputBind("e", INPUT_ACTION_ACCEPT)
|
|
|
|
inputBind("q", INPUT_ACTION_CANCEL)
|
|
|
|
inputBind("escape", INPUT_ACTION_RAGEQUIT)
|
|
end
|
|
|
|
if INPUT_GAMEPAD then
|
|
inputBind("gamepad_up", INPUT_ACTION_UP)
|
|
inputBind("gamepad_down", INPUT_ACTION_DOWN)
|
|
inputBind("gamepad_left", INPUT_ACTION_LEFT)
|
|
inputBind("gamepad_right", INPUT_ACTION_RIGHT)
|
|
|
|
inputBind("gamepad_a", INPUT_ACTION_ACCEPT)
|
|
inputBind("gamepad_b", INPUT_ACTION_CANCEL)
|
|
inputBind("gamepad_back", INPUT_ACTION_RAGEQUIT)
|
|
|
|
inputBind("gamepad_lstick_up", INPUT_ACTION_UP)
|
|
inputBind("gamepad_lstick_down", INPUT_ACTION_DOWN)
|
|
inputBind("gamepad_lstick_left", INPUT_ACTION_LEFT)
|
|
inputBind("gamepad_lstick_right", INPUT_ACTION_RIGHT)
|
|
end
|
|
|
|
if INPUT_POINTER then
|
|
inputBind("mouse_x", INPUT_ACTION_POINTERX)
|
|
inputBind("mouse_y", INPUT_ACTION_POINTERY)
|
|
end
|
|
else
|
|
print("Unknown platform, no default input bindings set.")
|
|
end
|
|
|
|
sceneSet('scene/minesweeper.lua') |