#NEWLINE# def get_event( self ) : #NEWLINE# #INDENT# '\n            Check for an event without waiting.\n            ' #NEWLINE# key = self . _screen . getch ( ) #NEWLINE# while ( key != ( - 1 ) ) : #NEWLINE# #INDENT# if ( key == curses . KEY_RESIZE ) : #NEWLINE# #INDENT# self . _re_sized = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == curses . KEY_MOUSE ) : #NEWLINE# #INDENT# ( _ , x , y , _ , bstate ) = curses . getmouse ( ) #NEWLINE# buttons = 0 #NEWLINE# if ( ( ( bstate & curses . BUTTON1_PRESSED ) != 0 ) or ( ( bstate & curses . BUTTON1_CLICKED ) != 0 ) ) : #NEWLINE# #INDENT# buttons |= MouseEvent . LEFT_CLICK #NEWLINE# #UNINDENT# if ( ( ( bstate & curses . BUTTON3_PRESSED ) != 0 ) or ( ( bstate & curses . BUTTON3_CLICKED ) != 0 ) ) : #NEWLINE# #INDENT# buttons |= MouseEvent . RIGHT_CLICK #NEWLINE# #UNINDENT# if ( ( bstate & curses . BUTTON1_DOUBLE_CLICKED ) != 0 ) : #NEWLINE# #INDENT# buttons |= MouseEvent . DOUBLE_CLICK #NEWLINE# #UNINDENT# return MouseEvent ( x , y , buttons ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key in self . _KEY_MAP ) : #NEWLINE# #INDENT# return KeyboardEvent ( self . _KEY_MAP [ key ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key != ( - 1 ) ) : #NEWLINE# #INDENT# return KeyboardEvent ( key ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# key = self . _screen . getch ( ) #NEWLINE# #UNINDENT# return None