From f9bef62e655dfc67d2e0e8e0869374bc14197c6c Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Sun, 8 Feb 2015 21:12:49 +0300 Subject: [PATCH] keys --- src/dlangui/core/events.d | 6 ++++++ src/dlangui/widgets/editors.d | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/dlangui/core/events.d b/src/dlangui/core/events.d index ac25daa7..4276cdd6 100644 --- a/src/dlangui/core/events.d +++ b/src/dlangui/core/events.d @@ -1026,6 +1026,12 @@ string keyName(uint keyCode) { return "8"; case KeyCode.KEY_9: return "9"; + case KeyCode.KEY_DIVIDE: + return "/"; + case KeyCode.KEY_MULTIPLY: + return "*"; + case KeyCode.TAB: + return "Tab"; case KeyCode.F1: return "F1"; case KeyCode.F2: diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 89585176..fbeeee3b 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -409,6 +409,12 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction /// override to change popup menu items state override bool isActionEnabled(const Action action) { switch (action.id) { + case EditorActions.ToggleBlockComment: + return !_selectionRange.empty; + case EditorActions.ToggleLineComment: + case EditorActions.Tab: + case EditorActions.BackTab: + return true; case EditorActions.Copy: return !_selectionRange.empty; case EditorActions.Cut: