def quit_player(): ''' Signals the player to shut down gracefully, by sending the ESC keystroke. There is a possiblity it may not succeed if the keystroke is lost. ''' import scalatools _log.info('called.') scalatools.send_key('escape')
def scmd_send_key(*args): ''' Send a virtual key press event to this listener\'s machine. Example: send_key f5 ''' import scalatools as st if not args: raise TypeError, 'no arguments given.' for key in args: if not st.send_key(key): return 'ERROR key not found.'