76 lines
2.6 KiB
JavaScript
76 lines
2.6 KiB
JavaScript
// Default input bindings.
|
|
if (typeof PSP !== 'undefined') {
|
|
inputBind("up", INPUT_ACTION_UP);
|
|
inputBind("down", INPUT_ACTION_DOWN);
|
|
inputBind("left", INPUT_ACTION_LEFT);
|
|
inputBind("right", INPUT_ACTION_RIGHT);
|
|
inputBind("accept", INPUT_ACTION_ACCEPT);
|
|
inputBind("cancel", INPUT_ACTION_CANCEL);
|
|
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);
|
|
inputBind("triangle", INPUT_ACTION_CONSOLE);
|
|
|
|
} else if (typeof DOLPHIN !== 'undefined') {
|
|
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_CONSOLE);
|
|
inputBind("lstick_up", INPUT_ACTION_UP);
|
|
inputBind("lstick_down", INPUT_ACTION_DOWN);
|
|
inputBind("lstick_left", INPUT_ACTION_LEFT);
|
|
inputBind("lstick_right", INPUT_ACTION_RIGHT);
|
|
|
|
} else if (typeof LINUX !== 'undefined') {
|
|
if (typeof INPUT_KEYBOARD !== 'undefined') {
|
|
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);
|
|
inputBind("`", INPUT_ACTION_CONSOLE);
|
|
}
|
|
|
|
if (typeof INPUT_GAMEPAD !== 'undefined') {
|
|
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);
|
|
}
|
|
|
|
if (typeof INPUT_POINTER !== 'undefined') {
|
|
inputBind("mouse_x", INPUT_ACTION_POINTERX);
|
|
inputBind("mouse_y", INPUT_ACTION_POINTERY);
|
|
}
|
|
|
|
} else {
|
|
consolePrint("Unknown platform, no default input bindings set.");
|
|
}
|
|
|
|
Scene.set('scenes/cube.js');
|