From d8d3043dac24feef90d1ff43a9f2bb0dadf84386 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Fri, 14 Oct 2016 13:11:19 +0300 Subject: [PATCH] keyevent noModifiers property --- src/dlangui/core/events.d | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dlangui/core/events.d b/src/dlangui/core/events.d index 99d97bc0..5a4b6ea5 100644 --- a/src/dlangui/core/events.d +++ b/src/dlangui/core/events.d @@ -1236,6 +1236,10 @@ class KeyEvent { @property uint flags() { return _flags; } /// entered text, for Text action @property dstring text() { return _text; } + + /// returns true if no modifier flags are set + @property bool noModifiers() { return (_flags & (KeyFlag.Control | KeyFlag.Alt | KeyFlag.Menu | KeyFlag.Shift)) == 0; } + /// create key event this(KeyAction action, uint keyCode, uint flags, dstring text = null) { _action = action;