From 3181cbef09bf26e7cd986ffb348345fc7aca6d70 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Mon, 4 Sep 2017 12:33:07 +0300 Subject: [PATCH] flags processing for AltGr text input #414 --- src/dlangui/platforms/sdl/sdlapp.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dlangui/platforms/sdl/sdlapp.d b/src/dlangui/platforms/sdl/sdlapp.d index afdd78e8..0c9f4e81 100644 --- a/src/dlangui/platforms/sdl/sdlapp.d +++ b/src/dlangui/platforms/sdl/sdlapp.d @@ -991,6 +991,12 @@ class SDLWindow : Window { uint flags = convertKeyFlags(SDL_GetModState()); //do not handle Ctrl+Space as text https://github.com/buggins/dlangui/issues/160 //but do hanlde RAlt https://github.com/buggins/dlangide/issues/129 + debug(KeyInput) Log.d(" processTextInput char=", ds, "(", cast(int)ds[0], ") flags=", "%04x"d.format(flags)); + if ((flags & KeyFlag.Alt) && (flags & KeyFlag.Control)) { + flags &= (~(KeyFlag.LRAlt)) & (~(KeyFlag.LRControl)); + debug(KeyInput) Log.d(" processTextInput removed Ctrl+Alt flags char=", ds, "(", cast(int)ds[0], ") flags=", "%04x"d.format(flags)); + } + if (flags & KeyFlag.Control || (flags & KeyFlag.LAlt) == KeyFlag.LAlt || flags & KeyFlag.Menu) return true;