From 3f411854753a1e19f7581148800fad4d319bad8d Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Mon, 17 Nov 2025 11:42:10 +0100 Subject: [PATCH] Simplify keyboard --- internal_filesystem/lib/mpos/ui/keyboard.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/internal_filesystem/lib/mpos/ui/keyboard.py b/internal_filesystem/lib/mpos/ui/keyboard.py index 3f8620f1..524453ee 100644 --- a/internal_filesystem/lib/mpos/ui/keyboard.py +++ b/internal_filesystem/lib/mpos/ui/keyboard.py @@ -110,23 +110,20 @@ class MposKeyboard: self._keyboard.set_style_min_height(165, 0) def _handle_events(self, event): - event_code=event.get_code() - if event_code in [19,23,24,25,26,27,28,29,30,31,32,33,39,49,52]: + # Only process VALUE_CHANGED events for actual typing + if event.get_code() != lv.EVENT.VALUE_CHANGED: return - name = mpos.ui.get_event_name(event_code) - print(f"lv_event_t: code={event_code}, name={name}") - # Get the pressed button and its text target_obj=event.get_target_obj() # keyboard + if not target_obj: + return button = target_obj.get_selected_button() + if not button: + return text = target_obj.get_button_text(button) print(f"[KBD] btn={button}, mode={self._current_mode}, text='{text}'") - # Only process VALUE_CHANGED events for actual typing - if event_code != lv.EVENT.VALUE_CHANGED: - return - # Ignore if no valid button text (can happen during mode switching) if text is None: return