@@ -253,8 +253,18 @@ def __getattr__(self, name):
253253 return getattr (self ._keyboard , name )
254254
255255 def scroll_after_show (self , timer ):
256- self ._keyboard .scroll_to_view_recursive (True )
257256 #self._textarea.scroll_to_view_recursive(True) # makes sense but doesn't work and breaks the keyboard scroll
257+ self ._keyboard .scroll_to_view_recursive (True )
258+
259+ def focus_on_keyboard (self , timer ):
260+ # Would be good to focus on the keyboard,
261+ # but somehow the focus styling is not applied,
262+ # so the user doesn't see which button is selected...
263+ default_group = lv .group_get_default ()
264+ if default_group :
265+ from .focus_direction import emulate_focus_obj , move_focus_direction
266+ emulate_focus_obj (default_group , self ._keyboard )
267+ move_focus_direction (180 ) # Same issue
258268
259269 def scroll_back_after_hide (self , timer ):
260270 self ._parent .scroll_to_y (self ._saved_scroll_y , True )
@@ -263,10 +273,10 @@ def show_keyboard(self):
263273 self ._saved_scroll_y = self ._parent .get_scroll_y ()
264274 mpos .ui .anim .smooth_show (self ._keyboard , duration = 500 )
265275 # Scroll to view on a timer because it will be hidden initially
266- scroll_timer = lv .timer_create (self .scroll_after_show ,250 ,None )
267- scroll_timer .set_repeat_count (1 )
276+ lv .timer_create (self .scroll_after_show ,250 ,None ). set_repeat_count ( 1 )
277+ #focus_timer = lv.timer_create(self.focus_on_keyboard,750,None) .set_repeat_count(1)
268278
269279 def hide_keyboard (self ):
270280 mpos .ui .anim .smooth_hide (self ._keyboard , duration = 500 )
271- scroll_timer = lv . timer_create ( self . scroll_back_after_hide , 550 , None ) # do it after the hide so the scrollbars disappear automatically if not needed
272- scroll_timer .set_repeat_count (1 )
281+ # Do this after the hide so the scrollbars disappear automatically if not needed
282+ scroll_timer = lv . timer_create ( self . scroll_back_after_hide , 550 , None ) .set_repeat_count (1 )
0 commit comments