diff --git a/apps/code/editor_controller.cpp b/apps/code/editor_controller.cpp index 863a29191..583e54cc1 100644 --- a/apps/code/editor_controller.cpp +++ b/apps/code/editor_controller.cpp @@ -78,6 +78,15 @@ bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events: return true; } + if(event.hasText()){ + if(event.text() == "%" && Ion::Events::isLockActive() ){ + return textArea->removePreviousGlyph(); + } else { + return textArea->handleEventWithText(event.text(), true, false); + } + } + + if (event == Ion::Events::Backspace && textArea->selectionIsEmpty()) { /* If the cursor is on the left of the text of a line, backspace one * indentation space at a time. */ diff --git a/escher/src/text_field.cpp b/escher/src/text_field.cpp index 51be16c30..6e8cd0303 100644 --- a/escher/src/text_field.cpp +++ b/escher/src/text_field.cpp @@ -408,6 +408,11 @@ CodePoint TextField::XNTCodePoint(CodePoint defaultXNTCodePoint) { } bool TextField::handleEvent(Ion::Events::Event event) { + if(event.hasText()){ + if(event.text() == "%" && Ion::Events::isLockActive() ){ + return removePreviousGlyph(); + } + } assert(m_delegate != nullptr); size_t previousTextLength = strlen(text()); bool didHandleEvent = false;