mirror of https://github.com/buggins/dlangui.git
Make Editors respect onKeyEvent
This commit is contained in:
parent
7895e417d9
commit
25bc5ef4b9
|
@ -2103,6 +2103,8 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
|||
/// handle keys
|
||||
override bool onKeyEvent(KeyEvent event) {
|
||||
//Log.d("onKeyEvent ", event.action, " ", event.keyCode, " flags ", event.flags);
|
||||
if(super.onKeyEvent(event))
|
||||
return true;
|
||||
if (focused) startCaretBlinking();
|
||||
cancelHoverTimer();
|
||||
bool ctrlOrAltPressed = !!(event.flags & KeyFlag.Control); //(event.flags & (KeyFlag.Control /* | KeyFlag.Alt */));
|
||||
|
@ -2133,7 +2135,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
|||
//if (event.keyCode == KeyCode.RETURN && !readOnly && !_content.multiline) {
|
||||
// return true;
|
||||
//}
|
||||
return super.onKeyEvent(event);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Handle Ctrl + Left mouse click on text
|
||||
|
@ -2449,6 +2451,8 @@ class EditLine : EditWidgetBase {
|
|||
|
||||
/// handle keys
|
||||
override bool onKeyEvent(KeyEvent event) {
|
||||
if(super.onKeyEvent(event))
|
||||
return true;
|
||||
if (enterKey.assigned) {
|
||||
if (event.keyCode == KeyCode.RETURN && event.modifiers == 0) {
|
||||
if (event.action == KeyAction.KeyDown)
|
||||
|
@ -2459,7 +2463,7 @@ class EditLine : EditWidgetBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
return super.onKeyEvent(event);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// process mouse event; return true if event is processed by widget.
|
||||
|
|
Loading…
Reference in New Issue