mirror of https://github.com/buggins/dlangui.git
Menu/Win (Command) key support; OSX native shortcuts - close #121
This commit is contained in:
parent
f3f89282f8
commit
f4d26fa758
|
@ -769,7 +769,11 @@ enum KeyFlag : uint {
|
|||
/// Left Shift key is down
|
||||
LShift = 0x0204,
|
||||
/// Left Alt key is down
|
||||
LAlt = 0x0280
|
||||
LAlt = 0x0280,
|
||||
/// Left Menu/Win key is down
|
||||
LMenu = 0x0240,
|
||||
/// Right Menu/Win key is down
|
||||
RMenu = 0x0140
|
||||
}
|
||||
|
||||
/// Key code constants for KeyEvent
|
||||
|
|
|
@ -1555,6 +1555,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
|||
|
||||
/// handle keys
|
||||
override bool onKeyEvent(KeyEvent event) {
|
||||
//Log.d("onKeyEvent ", event.action, " ", event.keyCode, " flags ", event.flags);
|
||||
if (focused) startCaretBlinking();
|
||||
cancelHoverTimer();
|
||||
bool ctrlOrAltPressed = false; //(event.flags & (KeyFlag.Control /* | KeyFlag.Alt */));
|
||||
|
@ -1595,7 +1596,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
|||
protected void onHover(Point pos) {
|
||||
if (_hoverMousePosition == pos)
|
||||
return;
|
||||
Log.d("onHover ", pos);
|
||||
//Log.d("onHover ", pos);
|
||||
int x = pos.x - left - _leftPaneWidth;
|
||||
int y = pos.y - top;
|
||||
_hoverMousePosition = pos;
|
||||
|
|
|
@ -1100,7 +1100,7 @@ public:
|
|||
if (keyEvent.assigned && keyEvent(this, event))
|
||||
return true; // processed by external handler
|
||||
if (event.action == KeyAction.KeyDown) {
|
||||
Action action = findKeyAction(event.keyCode, event.flags & (KeyFlag.Shift | KeyFlag.Alt | KeyFlag.Control));
|
||||
Action action = findKeyAction(event.keyCode, event.flags & (KeyFlag.Shift | KeyFlag.Alt | KeyFlag.Control | KeyFlag.Menu));
|
||||
if (action !is null) {
|
||||
return dispatchAction(action);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue