Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-07-14 02:46:14 +0300
committerCampbell Barton <campbell@blender.org>2022-07-14 02:46:58 +0300
commit09a74ff8b6e815f3642229355be0a08dc1bcb391 (patch)
tree612e7a04f124ff639a4cfe2074fe554ecbc2cbdb
parent50d832634eaa1b309306c4596f4213244213e104 (diff)
GHOST/SDL: add support for the key repeat flag
Now all ghost back-ends support the key repeat flag (accessed as WM_EVENT_IS_REPEAT from wmEvent.flag).
-rw-r--r--intern/ghost/intern/GHOST_SystemSDL.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index a29bfd9489d..0ca37adced6 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -457,6 +457,7 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
SDL_Keycode sym = sdl_sub_evt.keysym.sym;
GHOST_TEventType type = (sdl_sub_evt.state == SDL_PRESSED) ? GHOST_kEventKeyDown :
GHOST_kEventKeyUp;
+ const bool is_repeat = sdl_sub_evt.repeat != 0;
GHOST_WindowSDL *window = findGhostWindow(
SDL_GetWindowFromID_fallback(sdl_sub_evt.windowID));
@@ -596,7 +597,7 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
}
}
- g_event = new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym, nullptr, false);
+ g_event = new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym, nullptr, is_repeat);
break;
}
}