mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-23 03:01:08 +00:00
Use SDL_Start/StopTextInput() also with SDL2
Based on whether handleMouseGrab() in events.cpp sets GRAB_ENABLETEXTINPUT or not. Should prevent the issue that on macOS pressing a button for longer while playing (as one does, e.g. to run forward) opens a popup menu with alternative characters (like "è", "é", "ê", etc for "e")
This commit is contained in:
parent
c23d819f5e
commit
e3795a36e0
1 changed files with 5 additions and 0 deletions
|
@ -1191,6 +1191,11 @@ void GLimp_GrabInput(int flags) {
|
|||
SDL_ShowCursor( (flags & GRAB_HIDECURSOR) ? SDL_DISABLE : SDL_ENABLE );
|
||||
SDL_SetRelativeMouseMode( (flags & GRAB_RELATIVEMOUSE) ? SDL_TRUE : SDL_FALSE );
|
||||
SDL_SetWindowGrab( window, (flags & GRAB_GRABMOUSE) ? SDL_TRUE : SDL_FALSE );
|
||||
if (flags & GRAB_ENABLETEXTINPUT) {
|
||||
SDL_StartTextInput();
|
||||
} else {
|
||||
SDL_StopTextInput();
|
||||
}
|
||||
#else
|
||||
SDL_ShowCursor( (flags & GRAB_HIDECURSOR) ? SDL_DISABLE : SDL_ENABLE );
|
||||
// ignore GRAB_GRABMOUSE, SDL1.2 doesn't support grabbing without relative mode
|
||||
|
|
Loading…
Reference in a new issue