@@ -782,6 +782,7 @@ def __init__(self, profile, channels=(), dms=(), stars=(), title=''):
782782 self .stars = stars
783783 self .dms = dms
784784 self .groups = ()
785+ self .last_time_clicked = None
785786
786787 # Subscribe to receive message from channels to select them
787788 for channel in self .channels :
@@ -908,13 +909,20 @@ def keypress(self, size, key):
908909 return super (SideBar , self ).keypress (size , key )
909910
910911 def mouse_event (self , size , event , button , col , row , focus ):
911- if event == 'mouse press' and button in (4 , 5 ):
912- if button == 4 :
913- self .keypress (size , 'up' )
914- return True
912+ if event == 'mouse press' :
913+ if button in (4 , 5 ):
914+ if button == 4 :
915+ self .keypress (size , 'up' )
916+ return True
917+ else :
918+ self .keypress (size , 'down' )
919+ return True
915920 else :
916- self .keypress (size , 'down' )
917- return True
921+ now = time .time ()
922+ if self .last_time_clicked and (now - self .last_time_clicked < 0.5 ):
923+ self .keypress (size , 'enter' )
924+ self .last_time_clicked = now
925+
918926 return super (SideBar , self ).mouse_event (size , event , button , col , row , focus )
919927
920928
0 commit comments