#NEWLINE# def button_press_event( self , event ) : #NEWLINE# #INDENT# x = event . x #NEWLINE# y = event . y #NEWLINE# button = 0 #NEWLINE# if ( event . num != 0 ) : #NEWLINE# #INDENT# if ( event . num in ( 4 , 5 ) ) : #NEWLINE# #INDENT# direction = 0.0 #NEWLINE# if ( event . num == 5 ) : #NEWLINE# #INDENT# direction = 180.0 #NEWLINE# #UNINDENT# numDegrees = 15.0 #NEWLINE# self . logger . debug ( ( 'scroll deg=%f direction=%f' % ( numDegrees , direction ) ) ) #NEWLINE# ( data_x , data_y ) = self . get_data_xy ( x , y ) #NEWLINE# ( self . last_data_x , self . last_data_y ) = ( data_x , data_y ) #NEWLINE# return self . make_ui_callback ( 'scroll' , direction , numDegrees , data_x , data_y ) #NEWLINE# #UNINDENT# button |= ( 1 << ( event . num - 1 ) ) #NEWLINE# #UNINDENT# self . _button = button #NEWLINE# self . logger . debug ( ( 'button event at %dx%d, button=%x' % ( x , y , button ) ) ) #NEWLINE# ( data_x , data_y ) = self . get_data_xy ( x , y ) #NEWLINE# return self . make_ui_callback ( 'button-press' , button , data_x , data_y )