X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=f67bc13ecac7dc8bb5d3aed4e151383cea5b7439;hb=69e8efac8d856859c55237e085ff8b514ae1aa3c;hp=c497116ed6adb55b420a9718af18abd0be2e9820;hpb=26d4e05cb040620bcdc1ca995d8a231a40be46ff;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index c497116e..f67bc13e 100644 --- a/src/events.c +++ b/src/events.c @@ -176,6 +176,16 @@ void ClearEventQueue() } } +void ClearPlayerAction() +{ + int i; + + /* simulate key release events for still pressed keys */ + key_joystick_mapping = 0; + for (i=0; itype == EVENT_FOCUSOUT) { - int i; - KeyboardAutoRepeatOn(); old_joystick_status = joystick.status; joystick.status = JOYSTICK_NOT_AVAILABLE; - /* simulate key release events for still pressed keys */ - key_joystick_mapping = 0; - for (i=0; itype == EVENT_FOCUSIN) { @@ -477,6 +482,7 @@ void HandleKey(Key key, int key_status) /* allow quick escape to the main menu with the Escape key */ if (key == KSYM_Escape && game_status != MAINMENU && + game_status != PLAYING && game_status != LEVELED && game_status != CHOOSELEVEL && game_status != SETUP) @@ -489,9 +495,9 @@ void HandleKey(Key key, int key_status) /* special shortcuts for quick game tape saving and loading */ if (game_status == MAINMENU || game_status == PLAYING) { - if (key == KSYM_F1) /* save game */ + if (key == setup.shortcut.save_game) TapeQuickSave(); - else if (key == KSYM_F2) /* load game */ + else if (key == setup.shortcut.load_game) TapeQuickLoad(); } @@ -592,6 +598,9 @@ void HandleKey(Key key, int key_status) { switch(key) { + case KSYM_Escape: + RequestQuitGame(setup.ask_on_escape); + break; #ifdef DEBUG case KSYM_0: @@ -767,11 +776,9 @@ static int HandleJoystickForAllPlayers() joy_action = Joystick(i); result |= joy_action; - if (!setup.input[i].use_joystick) continue; - stored_player[i].action = joy_action; }