@@ -142,7 +142,7 @@ def mouse_event(self, size: urwid_Size, event: str, button: int, col: int,
142142 return True
143143 return super ().mouse_event (size , event , button , col , row , focus )
144144
145- def keypress (self , size : urwid_Size , key : str ) -> str :
145+ def keypress (self , size : urwid_Size , key : str ) -> Optional [ str ] :
146146 if is_command_key ('NEXT_MESSAGE' , key ) and not self .new_loading :
147147 try :
148148 position = self .log .next_position (self .focus_position )
@@ -290,7 +290,7 @@ def mouse_event(self, size: urwid_Size, event: str, button: int, col: int,
290290 return True
291291 return super ().mouse_event (size , event , button , col , row , focus )
292292
293- def keypress (self , size : urwid_Size , key : str ) -> str :
293+ def keypress (self , size : urwid_Size , key : str ) -> Optional [ str ] :
294294 if is_command_key ('SEARCH_STREAMS' , key ):
295295 self .set_focus ('header' )
296296 return key
@@ -377,7 +377,7 @@ def mouse_event(self, size: urwid_Size, event: str, button: int, col: int,
377377 return True
378378 return super ().mouse_event (size , event , button , col , row , focus )
379379
380- def keypress (self , size : urwid_Size , key : str ) -> str :
380+ def keypress (self , size : urwid_Size , key : str ) -> Optional [ str ] :
381381 if is_command_key ('TOGGLE_TOPIC' , key ):
382382 # Exit topic view
383383 self .view .left_panel .contents [1 ] = (
@@ -461,7 +461,7 @@ def get_next_unread_pm(self) -> Optional[int]:
461461 return pm
462462 return None
463463
464- def keypress (self , size : urwid_Size , key : str ) -> str :
464+ def keypress (self , size : urwid_Size , key : str ) -> Optional [ str ] :
465465 if is_command_key ('GO_BACK' , key ):
466466 self .header .keypress (size , 'esc' )
467467 self .footer .keypress (size , 'esc' )
@@ -611,7 +611,7 @@ def users_view(self, users: Any=None) -> Any:
611611 self .view .user_w = user_w
612612 return user_w
613613
614- def keypress (self , size : urwid_Size , key : str ) -> str :
614+ def keypress (self , size : urwid_Size , key : str ) -> Optional [ str ] :
615615 if is_command_key ('SEARCH_PEOPLE' , key ):
616616 self .allow_update_user_list = False
617617 self .set_focus ('header' )
@@ -735,7 +735,7 @@ def topics_view(self, stream_button: Any) -> Any:
735735 )
736736 return w
737737
738- def keypress (self , size : urwid_Size , key : str ) -> str :
738+ def keypress (self , size : urwid_Size , key : str ) -> Optional [ str ] :
739739 if (is_command_key ('SEARCH_STREAMS' , key ) or
740740 is_command_key ('SEARCH_TOPICS' , key )):
741741 self .focus_position = 1
0 commit comments