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 87062d4d67.
This commit is contained in:
Julian Eisel 2020-08-10 18:24:31 +02:00
parent 3b08cb3236
commit 8ef05d3180
Notes: blender-bot 2023-02-14 08:28:46 +01:00
Referenced by issue #79636, Text Editor: Issues with ALT key
1 changed files with 4 additions and 2 deletions

View File

@ -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