fix problem with inputing of { and } in German locale, windows

This commit is contained in:
Vadim Lopatin 2015-12-09 15:55:54 +03:00
parent 94bc5d23b3
commit 167cc17d22
2 changed files with 8 additions and 5 deletions

View File

@ -700,14 +700,16 @@ class Win32Window : Window {
updateKeyFlags((GetKeyState(VK_MENU) & 0x8000) != 0 ? KeyAction.KeyDown : KeyAction.KeyUp, KeyFlag.Alt);
break;
}
//updateKeyFlags((GetKeyState(VK_CONTROL) & 0x8000) != 0 ? KeyAction.KeyDown : KeyAction.KeyUp, KeyFlag.Control);
//updateKeyFlags((GetKeyState(VK_SHIFT) & 0x8000) != 0 ? KeyAction.KeyDown : KeyAction.KeyUp, KeyFlag.Shift);
//updateKeyFlags((GetKeyState(VK_MENU) & 0x8000) != 0 ? KeyAction.KeyDown : KeyAction.KeyUp, KeyFlag.Alt);
if (keyCode == 0xBF)
keyCode = KeyCode.KEY_DIVIDE;
event = new KeyEvent(action, keyCode, _keyFlags);
} else if (action == KeyAction.Text && character != 0) {
if (_keyFlags & (KeyFlag.Control | KeyFlag.Alt)) {
if (character >= 1 && character <= 26) {
event = new KeyEvent(action, KeyCode.KEY_A + character - 1, _keyFlags);
}
bool ctrlAZKeyCode = (character >= 1 && character <= 26);
if ((_keyFlags & (KeyFlag.Control | KeyFlag.Alt)) && ctrlAZKeyCode) {
event = new KeyEvent(action, KeyCode.KEY_A + character - 1, _keyFlags);
} else {
dchar[] text;
text ~= character;

View File

@ -1410,7 +1410,8 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
/// handle keys
override bool onKeyEvent(KeyEvent event) {
if (focused) startCaretBlinking();
if (event.action == KeyAction.Text && event.text.length && !(event.flags & (KeyFlag.Control | KeyFlag.Alt))) {
bool ctrlOrAltPressed = false; //(event.flags & (KeyFlag.Control /* | KeyFlag.Alt */));
if (event.action == KeyAction.Text && event.text.length && !ctrlOrAltPressed) {
Log.d("text entered: ", event.text);
if (readOnly)
return true;