[Bf-blender-cvs] [87062d4d670] blender-v2.90-release: Fix T78412: Ctrl+Spacebar does not maximize Python console on Windows

Julian Eisel noreply at git.blender.org
Wed Aug 5 15:51:19 CEST 2020


Commit: 87062d4d670c01c9c0835057aaf4164aea971e00
Author: Julian Eisel
Date:   Wed Aug 5 15:40:37 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rB87062d4d670c01c9c0835057aaf4164aea971e00

Fix T78412: Ctrl+Spacebar does not maximize Python console on Windows

On windows, spacebar would be passed as UTF-8 text input, despite the
control key being pressed. On macOS, there already was an explicit
exception for this (command key in this case), on Linux XInput already
handled this case for us.
Note that Alt should still allow text input, for special character
sequences.

Issue also happened in the Text Editor if a text data-block was set.

===================================================================

M	intern/ghost/intern/GHOST_SystemWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 849aa5a96f5..db26bd6a614 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1144,9 +1144,13 @@ GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_WindowWin32 *window, RA
     int r;
     GetKeyboardState((PBYTE)state);
 
+    /* No text with control key pressed. */
+    if (state[VK_CONTROL] & 0x80) {
+      utf8_char[0] = '\0';
+    }
     // Don't call ToUnicodeEx on dead keys as it clears the buffer and so won't allow diacritical
     // composition.
-    if (MapVirtualKeyW(vk, 2) != 0) {
+    else if (MapVirtualKeyW(vk, 2) != 0) {
       // todo: ToUnicodeEx can respond with up to 4 utf16 chars (only 2 here).
       // Could be up to 24 utf8 bytes.
       if ((r = ToUnicodeEx(



More information about the Bf-blender-cvs mailing list