From b5ef0e8f5a5474d88ed7b9ea28a70f9dda1255a1 Mon Sep 17 00:00:00 2001 From: Brendan McGrath Date: Thu, 15 Feb 2024 12:57:09 +1100 Subject: [PATCH] Treat all keys as a CmdKey --- src/FNAPlatform/SDL2_FNAPlatform.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/FNAPlatform/SDL2_FNAPlatform.cs b/src/FNAPlatform/SDL2_FNAPlatform.cs index 7bcdbf4d9..e275d865a 100644 --- a/src/FNAPlatform/SDL2_FNAPlatform.cs +++ b/src/FNAPlatform/SDL2_FNAPlatform.cs @@ -94,6 +94,13 @@ protected override void CreateHandle() FNALoggerEXT.LogWarn(e.ToString()); } } + + protected override bool ProcessCmdKey ( + ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) + { + WndProc(ref msg); + return true; + } } private static Dictionary forms = new Dictionary(); @@ -145,6 +152,10 @@ public static string ProgramInit(LaunchParameters args) "1" ); } + SDL.SDL_SetHint( + SDL.SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP, + "0" + ); } /* Mount TitleLocation.Path */ @@ -1010,6 +1021,7 @@ ref bool textInputSuppress ) { SDL.SDL_Event evt; char* charsBuffer = stackalloc char[32]; // SDL_TEXTINPUTEVENT_TEXT_SIZE + System.Windows.Forms.Application.DoEvents(); while (SDL.SDL_PollEvent(out evt) == 1) { // Keyboard