#NEWLINE# @ window . event #NEWLINE# def on_key_press( symbol , modifiers ) : #NEWLINE# #INDENT# print ( ( 'key %s was pressed' % symbol ) ) #NEWLINE# if ( modifiers == key . A ) : #NEWLINE# #INDENT# print ( 'The "A" key was pressed.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( symbol == key . LEFT ) : #NEWLINE# #INDENT# print ( 'The left arrow key was pressed.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( symbol == key . ENTER ) : #NEWLINE# #INDENT# print ( 'The enter key was pressed.' )