| | |
| | | SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); |
| | | SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); |
| | | SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE); |
| | | #if 0 /* Leave these events enabled so apps can respond to items being dragged onto them at startup */ |
| | | SDL_EventState(SDL_DROPFILE, SDL_DISABLE); |
| | | SDL_EventState(SDL_DROPTEXT, SDL_DISABLE); |
| | | #endif |
| | | |
| | | SDL_AtomicSet(&SDL_EventQ.active, 1); |
| | | |
| | |
| | | void |
| | | SDL_FlushEvents(Uint32 minType, Uint32 maxType) |
| | | { |
| | | /* !!! FIXME: we need to manually SDL_free() the strings in TEXTINPUT and |
| | | drag'n'drop events if we're flushing them without passing them to the |
| | | app, but I don't know if this is the right place to do that. */ |
| | | |
| | | /* Don't look after we've quit */ |
| | | if (!SDL_AtomicGet(&SDL_EventQ.active)) { |
| | | return; |
| | |
| | | /* Check for joystick state change */ |
| | | if ((!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || SDL_JoystickEventState(SDL_QUERY))) { |
| | | SDL_JoystickUpdate(); |
| | | } |
| | | #endif |
| | | |
| | | #if !SDL_SENSOR_DISABLED |
| | | /* Check for sensor state change */ |
| | | if (!SDL_disabled_events[SDL_SENSORUPDATE >> 8]) { |
| | | SDL_SensorUpdate(); |
| | | } |
| | | #endif |
| | | |
| | |
| | | Uint8 |
| | | SDL_EventState(Uint32 type, int state) |
| | | { |
| | | const SDL_bool isdnd = ((state == SDL_DISABLE) || (state == SDL_ENABLE)) && |
| | | ((type == SDL_DROPFILE) || (type == SDL_DROPTEXT)); |
| | | Uint8 current_state; |
| | | Uint8 hi = ((type >> 8) & 0xff); |
| | | Uint8 lo = (type & 0xff); |
| | |
| | | } |
| | | } |
| | | |
| | | /* turn off drag'n'drop support if we've disabled the events. |
| | | This might change some UI details at the OS level. */ |
| | | if (isdnd) { |
| | | SDL_ToggleDragAndDropSupport(); |
| | | } |
| | | |
| | | return current_state; |
| | | } |
| | | |