X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fevents.c;h=f8a888ade1161aafedc37b655bd711f8a5d9858b;hp=8c8ae5a910f25ee6fb41a11d0661dad4bd062e0a;hb=7b6d70dfe3762a3ea666871df51c284a4377d5cf;hpb=363a87ea9e17020bfb820f9f19a9c68a07fec120 diff --git a/src/events.c b/src/events.c index 8c8ae5a9..f8a888ad 100644 --- a/src/events.c +++ b/src/events.c @@ -268,8 +268,12 @@ void HandleOtherEvents(Event *event) HandleJoystickEvent(event); break; - case SDL_SYSWMEVENT: - HandleWindowManagerEvent(event); + case SDL_DROPFILE: + HandleDropFileEvent(event); + break; + + case SDL_DROPTEXT: + HandleDropTextEvent(event); break; default: @@ -1522,9 +1526,28 @@ void HandleClientMessageEvent(ClientMessageEvent *event) CloseAllAndExit(0); } -void HandleWindowManagerEvent(Event *event) +static void HandleDropFileEventExt(char *filename) +{ + Error(ERR_DEBUG, "DROP FILE EVENT: '%s'", filename); +} + +static void HandleDropTextEventExt(char *text) +{ + Error(ERR_DEBUG, "DROP TEXT EVENT: '%s'", text); +} + +void HandleDropFileEvent(Event *event) +{ + HandleDropFileEventExt(event->drop.file); + + SDL_free(event->drop.file); +} + +void HandleDropTextEvent(Event *event) { - SDLHandleWindowManagerEvent(event); + HandleDropTextEventExt(event->drop.file); + + SDL_free(event->drop.file); } void HandleButton(int mx, int my, int button, int button_nr) @@ -1849,9 +1872,9 @@ boolean HandleKeysDebug(Key key, int key_status) return TRUE; } } +#endif return FALSE; -#endif } void HandleKey(Key key, int key_status) @@ -2360,6 +2383,16 @@ void HandleJoystick(void) return; } + if (newbutton && (game_status == GAME_MODE_PSEUDO_TYPENAME || + anyTextGadgetActive())) + { + // leave name input in main menu or text input gadget + HandleKey(KSYM_Escape, KEY_PRESSED); + HandleKey(KSYM_Escape, KEY_RELEASED); + + return; + } + if (level.game_engine_type == GAME_ENGINE_TYPE_MM) { if (game_status == GAME_MODE_PLAYING)