default binds

This commit is contained in:
2025-11-03 14:33:42 -06:00
parent 3ef6205ea3
commit b4fb7bf99f
7 changed files with 49 additions and 1 deletions

View File

@@ -23,6 +23,41 @@ void inputInit(void) {
}
INPUT.deadzone = 0.1f;
// Setup Default Binds
#if INPUT_SDL2 == 1
#if INPUT_KEYBOARD == 1
inputBind(inputButtonGetByName("up"), INPUT_ACTION_UP);
inputBind(inputButtonGetByName("down"), INPUT_ACTION_DOWN);
inputBind(inputButtonGetByName("left"), INPUT_ACTION_LEFT);
inputBind(inputButtonGetByName("right"), INPUT_ACTION_RIGHT);
inputBind(inputButtonGetByName("w"), INPUT_ACTION_UP);
inputBind(inputButtonGetByName("s"), INPUT_ACTION_DOWN);
inputBind(inputButtonGetByName("a"), INPUT_ACTION_LEFT);
inputBind(inputButtonGetByName("d"), INPUT_ACTION_RIGHT);
inputBind(inputButtonGetByName("enter"), INPUT_ACTION_ACCEPT);
inputBind(inputButtonGetByName("escape"), INPUT_ACTION_RAGEQUIT);
inputBind(inputButtonGetByName("space"), INPUT_ACTION_ACCEPT);
inputBind(inputButtonGetByName("backspace"), INPUT_ACTION_CANCEL);
inputBind(inputButtonGetByName("e"), INPUT_ACTION_ACCEPT);
inputBind(inputButtonGetByName("q"), INPUT_ACTION_CANCEL);
#endif
#if INPUT_GAMEPAD == 1
#if PSP
inputBind(inputButtonGetByName("up"), INPUT_ACTION_UP);
inputBind(inputButtonGetByName("down"), INPUT_ACTION_DOWN);
inputBind(inputButtonGetByName("left"), INPUT_ACTION_LEFT);
inputBind(inputButtonGetByName("right"), INPUT_ACTION_RIGHT);
inputBind(inputButtonGetByName("circle"), INPUT_ACTION_CANCEL);
inputBind(inputButtonGetByName("cross"), INPUT_ACTION_ACCEPT);
inputBind(inputButtonGetByName("lstick_negative_y"), INPUT_ACTION_UP);
inputBind(inputButtonGetByName("lstick_positive_y"), INPUT_ACTION_DOWN);
inputBind(inputButtonGetByName("lstick_negative_x"), INPUT_ACTION_LEFT);
inputBind(inputButtonGetByName("lstick_positive_x"), INPUT_ACTION_RIGHT);
#endif
#endif
#endif
}
void inputUpdate(void) {

View File

@@ -16,6 +16,7 @@ typedef enum {
INPUT_ACTION_RIGHT,
INPUT_ACTION_ACCEPT,
INPUT_ACTION_CANCEL,
INPUT_ACTION_RAGEQUIT,
INPUT_ACTION_COUNT
} inputaction_t;