Arrow keys work without Fn outside Text Entry

; . , / are arrows on their own unless the foreground App is editing
text (App::textEntryActive); Fn + those keys are arrows everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-02 13:59:49 +02:00
co-authored by Claude Opus 5.5
parent 51698a8011
commit 5fd351c45e
10 changed files with 82 additions and 6 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ const char* const kText =
"Bienvenue sur roro9stack ! Ce texte teste le retour \xC3\xA0 la ligne automatique et les "
"accents : \xC3\xA9t\xC3\xA9, \xC3\xA0 bient\xC3\xB4t, gar\xC3\xA7on, No\xC3\xABl, "
"ma\xC3\xAEtre, o\xC3\xB9.\n\n"
"Use Fn+; and Fn+. to scroll, ` to go back. Fn+` always returns to the Launcher.\n\n"
"Use ; and . to scroll, ` to go back. Fn+` always returns to the Launcher.\n\n"
"Unbreakablewordthatislongerthanawholelineofthescreen to test hard breaks.";
} // namespace
+1
View File
@@ -19,6 +19,7 @@ class DemoApp : public App {
explicit DemoApp(EventBus& bus) : bus_(bus) {}
void onEnter() override;
bool onKey(const KeyEvent& e) override;
bool textEntryActive() const override { return page_ == Page::Editor && !dialog_; }
void draw(Canvas& c) override;
private:
+1
View File
@@ -34,6 +34,7 @@ class SettingsApp : public App {
void onEnter() override;
bool onKey(const KeyEvent& e) override;
void update(uint32_t nowMs) override;
bool textEntryActive() const override { return page_ == Page::Text; }
void draw(Canvas& c) override;
private:
+3
View File
@@ -13,6 +13,9 @@ class SetupApp : public App {
public:
SetupApp(Settings& settings, AppManager& apps);
bool onKey(const KeyEvent& e) override;
bool textEntryActive() const override {
return wizard_.step() == SetupWizard::Step::LongName || wizard_.step() == SetupWizard::Step::ShortName;
}
void draw(Canvas& c) override;
private:
+1
View File
@@ -143,6 +143,7 @@ void loop() {
M5Cardputer.update();
if (M5Cardputer.Keyboard.isChange()) {
bool swallow = M5Cardputer.Keyboard.isPressed() && power->onKey(now); // only woke the screen
keyMapper.setTextEntry(apps->foreground().textEntryActive());
auto events = keyMapper.update(readKeys()); // always, so held keys are tracked
if (!swallow)
for (auto& e : events) apps->handleKey(e);