diff --git a/apps/code/app.cpp b/apps/code/app.cpp index 665a09ce4..10d372183 100644 --- a/apps/code/app.cpp +++ b/apps/code/app.cpp @@ -49,8 +49,10 @@ bool App::Snapshot::lockOnConsole() const { } void App::Snapshot::setOpt(const char * name, const char * value) { - if (strcmp(name, "script") == 0) { + if (strcmp(name, "wipe") == 0) { m_scriptStore.deleteAllScripts(); + } + if (strcmp(name, "script") == 0) { char * separator = const_cast(UTF8Helper::CodePointSearch(value, ':')); if (*separator == 0) { return; diff --git a/escher/src/text_area.cpp b/escher/src/text_area.cpp index e549b9dc5..837e341b7 100644 --- a/escher/src/text_area.cpp +++ b/escher/src/text_area.cpp @@ -116,14 +116,18 @@ bool TextArea::handleEvent(Ion::Events::Event event) { if (event == Ion::Events::ShiftUp || event == Ion::Events::ShiftDown) { selectUpDown(event == Ion::Events::ShiftUp); return true; - } else if (event == Ion::Events::ShiftLeft) { + } else if (event == Ion::Events::AlphaLeft) { contentView()->moveCursorGeo(-INT_MAX/2, 0); - } else if (event == Ion::Events::ShiftRight) { + TextInput::scrollToCursor(); + } else if (event == Ion::Events::AlphaRight) { contentView()->moveCursorGeo(INT_MAX/2, 0); - } else if (event == Ion::Events::ShiftUp) { + TextInput::scrollToCursor(); + } else if (event == Ion::Events::AlphaUp) { contentView()->moveCursorGeo(0, -INT_MAX/2); - } else if (event == Ion::Events::ShiftDown) { + TextInput::scrollToCursor(); + } else if (event == Ion::Events::AlphaDown) { contentView()->moveCursorGeo(0, INT_MAX/2); + TextInput::scrollToCursor(); } else if (event == Ion::Events::Left) { if (contentView()->resetSelection()) { return true; diff --git a/ion/include/ion/events.h b/ion/include/ion/events.h index 1d4cee1b8..def5dfe56 100644 --- a/ion/include/ion/events.h +++ b/ion/include/ion/events.h @@ -182,6 +182,11 @@ constexpr Event ShiftThree = Event::ShiftKey(Keyboard::Key::Three); // Alpha +constexpr Event AlphaLeft = Event::AlphaKey(Keyboard::Key::Left); +constexpr Event AlphaRight = Event::AlphaKey(Keyboard::Key::Right); +constexpr Event AlphaUp = Event::AlphaKey(Keyboard::Key::Up); +constexpr Event AlphaDown = Event::AlphaKey(Keyboard::Key::Down); + constexpr Event Colon = Event::AlphaKey(Keyboard::Key::XNT); constexpr Event SemiColon = Event::AlphaKey(Keyboard::Key::Var); constexpr Event DoubleQuotes = Event::AlphaKey(Keyboard::Key::Toolbox); diff --git a/ion/include/ion/keyboard/layout_B2/layout_events.h b/ion/include/ion/keyboard/layout_B2/layout_events.h index f6c773b79..b67988907 100644 --- a/ion/include/ion/keyboard/layout_B2/layout_events.h +++ b/ion/include/ion/keyboard/layout_B2/layout_events.h @@ -30,7 +30,7 @@ static constexpr EventData s_dataForEvent[4*Event::PageSize] = { TL(), TL(), TL(), TL(), TL(), U(), TL(), TL(), TL(), TL(), U(), U(), // Alpha - U(), U(), U(), U(), U(), U(), + TL(), TL(), TL(), TL(), U(), U(), U(), U(), U(), U(), U(), U(), U(), U(), T(":"), T(";"), T("\""), T("%"), T("a"), T("b"), T("c"), T("d"), T("e"), T("f"), @@ -75,7 +75,7 @@ static constexpr const char * s_nameForEvent[255] = { nullptr, nullptr, nullptr, "BrightnessPlus", "BrightnessMinus", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, //Alpha, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + "AlphaLeft", "AlphaUp", "AlphaDown", "AlphaRight", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "Colon", "SemiColon", "DoubleQuotes", "Percent", "LowerA", "LowerB", "LowerC", "LowerD", "LowerE", "LowerF", diff --git a/ion/include/ion/keyboard/layout_B3/layout_events.h b/ion/include/ion/keyboard/layout_B3/layout_events.h index 447881bfc..8124c3e9d 100644 --- a/ion/include/ion/keyboard/layout_B3/layout_events.h +++ b/ion/include/ion/keyboard/layout_B3/layout_events.h @@ -30,7 +30,7 @@ static constexpr EventData s_dataForEvent[4*Event::PageSize] = { TL(), TL(), TL(), TL(), TL(), U(), TL(), TL(), TL(), TL(), U(), U(), // Alpha - U(), U(), U(), U(), U(), U(), + TL(), TL(), TL(), TL(), U(), U(), U(), U(), U(), U(), U(), U(), U(), U(), T(":"), T(";"), T("\""), T("%"), T("a"), T("b"), T("c"), T("d"), T("e"), T("f"), @@ -75,7 +75,7 @@ static constexpr const char * s_nameForEvent[255] = { nullptr, nullptr, nullptr, "BrightnessPlus", "BrightnessMinus", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, //Alpha, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + "AlphaLeft", "AlphaUp", "AlphaDown", "AlphaRight", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "Colon", "SemiColon", "DoubleQuotes", "Percent", "LowerA", "LowerB", "LowerC", "LowerD", "LowerE", "LowerF",