This issue was found by using GCC with option "-Wextra".
void HandleKeyEvent(KeyEvent *event)
{
int key_status = (event->type == EVENT_KEYPRESS ? KEY_PRESSED : KEY_RELEASED);
- boolean with_modifiers = (game_status == GAME_MODE_PLAYING ? FALSE : TRUE);
- Key key = GetEventKey(event, with_modifiers);
- Key keymod = (with_modifiers ? GetEventKey(event, FALSE) : key);
+ Key key = GetEventKey(event);
#if DEBUG_EVENTS_KEY
- Debug("event:key", "key was %s, keysym.scancode == %d, keysym.sym == %d, keymod = %d, GetKeyModState() = 0x%04x, resulting key == %d (%s)",
+ Debug("event:key", "key was %s, keysym.scancode == %d, keysym.sym == %d, GetKeyModState() = 0x%04x, resulting key == %d (%s)",
event->type == EVENT_KEYPRESS ? "pressed" : "released",
event->keysym.scancode,
event->keysym.sym,
- keymod,
GetKeyModState(),
key,
getKeyNameFromKey(key));
}
#endif
- HandleKeyModState(keymod, key_status);
+ HandleKeyModState(key, key_status);
// process all keys if not in text input mode or if non-printable keys
if (!checkTextInputKey(key))
program.exit_function(0);
}
-Key GetEventKey(KeyEvent *event, boolean with_modifiers)
+Key GetEventKey(KeyEvent *event)
{
// key up/down events in SDL2 do not return text characters anymore
return event->keysym.sym;
void PeekEvent(Event *event);
void PumpEvents(void);
void CheckQuitEvent(void);
-Key GetEventKey(KeyEvent *, boolean);
+Key GetEventKey(KeyEvent *);
KeyMod HandleKeyModState(Key, int);
KeyMod GetKeyModState(void);
KeyMod GetKeyModStateFromEvents(void);
{
case EVENT_KEYPRESS:
{
- key = GetEventKey((KeyEvent *)&event, TRUE);
+ key = GetEventKey((KeyEvent *)&event);
// press 'Escape' or 'Enter' to keep the existing key binding
if (key == KSYM_Escape || key == KSYM_Return)
{
case EVENT_KEYPRESS:
{
- Key key = GetEventKey((KeyEvent *)&event, FALSE);
+ Key key = GetEventKey((KeyEvent *)&event);
// press 'Escape' to abort and keep the old key bindings
if (key == KSYM_Escape)
case EVENT_KEYPRESS:
{
- Key key = GetEventKey((KeyEvent *)&event, FALSE);
+ Key key = GetEventKey((KeyEvent *)&event);
action = (key == KSYM_Escape ? ACTION_ESCAPE :
key == KSYM_BackSpace ||
case EVENT_KEYPRESS:
{
- Key key = GetEventKey((KeyEvent *)&event, TRUE);
+ Key key = GetEventKey((KeyEvent *)&event);
switch (key)
{