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
path: root/intern
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-08-10 19:24:31 +0300
committerJulian Eisel <julian@blender.org>2020-08-10 19:29:02 +0300
commit8ef05d3180b1b54c7647d059a1f8a6c610937bc9 (patch)
tree5bd67424b83b17ab879aa6cf4381d2e69a3291e6 /intern
parent3b08cb3236d506f89bde23f494e9883dd0bb5ed9 (diff)
Fix T79636: Inserting special characters with Ctrl+Alt broken on Windows
We can't exactly follow what we do for macOS here. On Windows special characters can be inserted with Ctrl+Alt. So make sure we expect UTF-8 characters when Alt is held. Mistake in 87062d4d670c.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index db26bd6a614..f59b106afd6 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1143,9 +1143,11 @@ GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_WindowWin32 *window, RA
BYTE state[256] = {0};
int r;
GetKeyboardState((PBYTE)state);
+ bool ctrl_pressed = state[VK_CONTROL] & 0x80;
+ bool alt_pressed = state[VK_MENU] & 0x80;
- /* No text with control key pressed. */
- if (state[VK_CONTROL] & 0x80) {
+ /* No text with control key pressed (Alt can be used to insert special characters though!). */
+ if (ctrl_pressed && !alt_pressed) {
utf8_char[0] = '\0';
}
// Don't call ToUnicodeEx on dead keys as it clears the buffer and so won't allow diacritical