diff --git a/src/dlangui/core/events.d b/src/dlangui/core/events.d index 4365f807..ac25daa7 100644 --- a/src/dlangui/core/events.d +++ b/src/dlangui/core/events.d @@ -720,6 +720,18 @@ enum KeyCode : uint { KEY_Y = 0x59, /// Z KEY_Z = 0x5a, + /// key / + KEY_DIVIDE = 0x6F, + /// key + + KEY_ADD = 0x6B, + /// key - + KEY_MULTIPLY = 0x6A, + /// key , + KEY_COMMA = 0xBC, + /// key . + KEY_PERIOD = 0xBE, + /// key - + KEY_SUBTRACT = 0x6D, /// left win key LWIN = 0x5b, /// right win key diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 30faaa12..a7fe4f4e 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -158,6 +158,14 @@ enum EditorActions : int { /// Zoom out editor font ZoomOut, + /// Togle line comment + ToggleLineComment, + /// Toggle block comment + ToggleBlockComment, + /// Delete current line + DeleteLine, + /// Insert line + InsertLine, } /// base for all editor widgets @@ -361,6 +369,11 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction new Action(EditorActions.ToggleReplaceMode, KeyCode.INS, 0), new Action(EditorActions.SelectAll, KeyCode.KEY_A, KeyFlag.Control), + + new Action(EditorActions.ToggleLineComment, KeyCode.KEY_DIVIDE, KeyFlag.Control), + new Action(EditorActions.ToggleBlockComment, KeyCode.KEY_DIVIDE, KeyFlag.Control | KeyFlag.Shift), + new Action(EditorActions.DeleteLine, KeyCode.KEY_Y, KeyFlag.Control), + new Action(EditorActions.InsertLine, KeyCode.RETURN, KeyFlag.Control), ]); }