Skip to content

Commit 3f41185

Browse files
Simplify keyboard
1 parent 0b196ad commit 3f41185

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

internal_filesystem/lib/mpos/ui/keyboard.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,20 @@ def __init__(self, parent):
110110
self._keyboard.set_style_min_height(165, 0)
111111

112112
def _handle_events(self, event):
113-
event_code=event.get_code()
114-
if event_code in [19,23,24,25,26,27,28,29,30,31,32,33,39,49,52]:
113+
# Only process VALUE_CHANGED events for actual typing
114+
if event.get_code() != lv.EVENT.VALUE_CHANGED:
115115
return
116116

117-
name = mpos.ui.get_event_name(event_code)
118-
print(f"lv_event_t: code={event_code}, name={name}")
119-
120117
# Get the pressed button and its text
121118
target_obj=event.get_target_obj() # keyboard
119+
if not target_obj:
120+
return
122121
button = target_obj.get_selected_button()
122+
if not button:
123+
return
123124
text = target_obj.get_button_text(button)
124125
print(f"[KBD] btn={button}, mode={self._current_mode}, text='{text}'")
125126

126-
# Only process VALUE_CHANGED events for actual typing
127-
if event_code != lv.EVENT.VALUE_CHANGED:
128-
return
129-
130127
# Ignore if no valid button text (can happen during mode switching)
131128
if text is None:
132129
return

0 commit comments

Comments
 (0)