From 0893259bf5ffb7eaf727c0be8cec02c5a31d1435 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Sun, 14 Sep 2014 14:17:50 +0200 Subject: [PATCH] Fixed so backspace deletes chars in edit mode Closes #93 --- ogl_editor/src/Editor.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ogl_editor/src/Editor.c b/ogl_editor/src/Editor.c index 29cc33a..accdd28 100644 --- a/ogl_editor/src/Editor.c +++ b/ogl_editor/src/Editor.c @@ -19,7 +19,10 @@ #include "../../sync/data.h" #include +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + static void updateNeedsSaving(); +static bool doEditing(int key); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1450,6 +1453,13 @@ void Editor_menuEvent(int menuItem) { int highlightRowStep = getTrackData()->highlightRowStep; + if (menuItem == EDITOR_MENU_DELETE_KEY && is_editing) + { + doEditing(EMGUI_KEY_BACKSPACE); + Editor_update(); + return; + } + switch (menuItem) { case EDITOR_MENU_ENTER_CURRENT_V : @@ -1501,6 +1511,7 @@ void Editor_menuEvent(int menuItem) case EDITOR_MENU_CANCEL_EDIT : onCancelEdit(); break; case EDITOR_MENU_DELETE_KEY : onDeleteKey(); break; + case EDITOR_MENU_CUT : onCutAndCopy(true); break; case EDITOR_MENU_COPY : onCutAndCopy(false); break; case EDITOR_MENU_PASTE : onPaste(); break;