def inputhook_wx1(context):
 try:
  app = wx.GetApp()
  if (app is not None):
   assert wx.Thread_IsMain()
   evtloop = wx.EventLoop()
   ea = wx.EventLoopActivator(evtloop)
   while evtloop.Pending():
    evtloop.Dispatch()
   app.ProcessIdle()
   del ea
 except KeyboardInterrupt:
  pass
 return 0

def inputhook_wx1 ( context ) : try : app = wx . GetApp ( ) if ( app is not None ) : assert wx . Thread_IsMain ( ) evtloop = wx . EventLoop ( ) ea = wx . EventLoopActivator ( evtloop ) while evtloop . Pending ( ) : evtloop . Dispatch ( ) app . ProcessIdle ( ) del ea except KeyboardInterrupt : pass return 0
run the wx event loop by processing pending events only .