X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=99b55fc85824f262bc15915ce469046a5c06a88a;hb=8fdd23c078934ae797980a824fd145903c84cae7;hp=04f69108527feaca46f5eca02ce2fc30b82f3ad9;hpb=9882a97f9526e64b5a9c1940ca0cd9994fdd6da9;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 04f69108..99b55fc8 100644 --- a/src/events.c +++ b/src/events.c @@ -1505,7 +1505,8 @@ static int HandleDropFileEvent(char *filename) Debug("event:dropfile", "filename == '%s'", filename); // check and extract dropped zip files into correct user data directory - if (!strSuffixLower(filename, ".zip")) + if (!strSuffixLower(filename, ".zip") && + !strPrefixLower(filename, "fd:")) { Warn("file '%s' not supported", filename); @@ -1615,6 +1616,12 @@ static void HandleDropCompleteEvent(int num_level_sets_succeeded, void HandleDropEvent(Event *event) { + Debug("event:drop", (event->type == SDL_DROPBEGIN ? "SDL_DROPBEGIN" : + event->type == SDL_DROPFILE ? "SDL_DROPFILE" : + event->type == SDL_DROPTEXT ? "SDL_DROPTEXT" : + event->type == SDL_DROPCOMPLETE ? "SDL_DROPCOMPLETE" : + "(unknown drop event type)")); + static boolean confirm_on_drop_complete = FALSE; static int num_level_sets_succeeded = 0; static int num_artwork_sets_succeeded = 0; @@ -2095,14 +2102,40 @@ void HandleKey(Key key, int key_status) { &ski.snap, NULL, DEFAULT_KEY_SNAP, JOY_BUTTON_SNAP }, { &ski.drop, NULL, DEFAULT_KEY_DROP, JOY_BUTTON_DROP } }; + boolean game_key_pressed = FALSE; int joy = 0; int i; - if (HandleKeysSpeed(key, key_status)) - return; // do not handle already processed keys again + // check if any game key is pressed (direction/snap/drop keys) + if (game_status == GAME_MODE_PLAYING) + { + int pnr; - if (HandleKeysDebug(key, key_status)) - return; // do not handle already processed keys again + for (pnr = 0; pnr < MAX_PLAYERS; pnr++) + { + ski = setup.input[pnr].key; + + for (i = 0; i < NUM_PLAYER_ACTIONS; i++) + if (key == *key_info[i].key_custom) + game_key_pressed = TRUE; + } + + ssi = setup.shortcut; + + for (i = 0; i < NUM_DIRECTIONS; i++) + if (key == *key_info[i].key_snap) + game_key_pressed = TRUE; + } + + // only handle speed or debug keys if no game key is pressed + if (!game_key_pressed) + { + if (HandleKeysSpeed(key, key_status)) + return; // do not handle already processed keys again + + if (HandleKeysDebug(key, key_status)) + return; // do not handle already processed keys again + } // map special keys (media keys / remote control buttons) to default keys if (key == KSYM_PlayPause)