diff options
Diffstat (limited to 'src/input.c')
| -rw-r--r-- | src/input.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/input.c b/src/input.c index 9e41ebe..db491dd 100644 --- a/src/input.c +++ b/src/input.c @@ -5,7 +5,7 @@ struct pw_input *pw_input_init(void) { struct pw_input *input = SDL_malloc(sizeof(*input)); if (!input) { - return false; + return NULL; } SDL_zerop(input); @@ -195,7 +195,7 @@ bool pw_input_event(struct pw_input *input, struct pw_players *players, return false; } if (!players) { - SDL_InvalidParamError("input"); + SDL_InvalidParamError("players"); return false; } if (!event) { @@ -225,19 +225,19 @@ static void update_keymod(struct pw_input *input) { input->keyboard.mod |= PW_KEYMOD_LSHIFT; } if (state & SDL_KMOD_RSHIFT) { - input->keyboard.mod |= PW_KEYMOD_LSHIFT; + input->keyboard.mod |= PW_KEYMOD_RSHIFT; } if (state & SDL_KMOD_LCTRL) { - input->keyboard.mod |= PW_KEYMOD_LSHIFT; + input->keyboard.mod |= PW_KEYMOD_LCTRL; } if (state & SDL_KMOD_RCTRL) { - input->keyboard.mod |= PW_KEYMOD_LSHIFT; + input->keyboard.mod |= PW_KEYMOD_RCTRL; } if (state & SDL_KMOD_LALT) { - input->keyboard.mod |= PW_KEYMOD_LSHIFT; + input->keyboard.mod |= PW_KEYMOD_LALT; } if (state & SDL_KMOD_RALT) { - input->keyboard.mod |= PW_KEYMOD_LSHIFT; + input->keyboard.mod |= PW_KEYMOD_RALT; } } @@ -299,7 +299,7 @@ enum pw_button pw_input_btn(struct pw_input *input, size_t player) { // menu needs to be set if it is set for any player. if (!player) { for (size_t i = 1; i < PW_PLAYERS_MAX; i++) { - button |= input->players[player] & PW_BUTTON_MENU; + button |= input->players[i] & PW_BUTTON_MENU; } } |
