File tree Expand file tree Collapse file tree
internal_filesystem/lib/drivers/indev Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import lvgl as lv
22import keypad_framework
33
4+ import mpos .ui
5+ import mpos .ui .focus_direction
6+
47
58_MOD_LSHIFT = 0x02
69_MOD_RSHIFT = 0x20
@@ -121,5 +124,17 @@ def _poll(self):
121124 def _get_key (self ):
122125 self ._poll ()
123126 if self ._queue :
124- return self ._queue .pop (0 )
127+ state , key = self ._queue .pop (0 )
128+ if state == self .PRESSED :
129+ if key == lv .KEY .ESC :
130+ mpos .ui .back_screen ()
131+ elif key == lv .KEY .RIGHT :
132+ mpos .ui .focus_direction .move_focus_direction (90 )
133+ elif key == lv .KEY .LEFT :
134+ mpos .ui .focus_direction .move_focus_direction (270 )
135+ elif key == lv .KEY .UP :
136+ mpos .ui .focus_direction .move_focus_direction (0 )
137+ elif key == lv .KEY .DOWN :
138+ mpos .ui .focus_direction .move_focus_direction (180 )
139+ return state , key
125140 return None
You can’t perform that action at this time.
0 commit comments