    return ""
  
  if __name__ == '__main__':
    threading.Thread(target=handle_timeout, daemon=True).start()
    app.run(host="0.0.0.0")
  
 
</s>
def handle_timeout():
  while 1:
    this_time = time.time()
    if (last_send_time+0.5) < this_time:
      print("timeout, no web in %.2f s" % (this_time-last_send_time))
      dat = messaging.new_message('testJoystick')
      dat.testJoystick.axes = [0,0]
      dat.testJoystick.buttons = [False]
      pm.send('testJoystick', dat)
    time.sleep(0.1)

    return ""
  
def handle_timeout():
  while 1:
    this_time = time.time()
    if (last_send_time+0.5) < this_time:
      print("timeout, no web in %.2f s" % (this_time-last_send_time))
      dat = messaging.new_message('testJoystick')
      dat.testJoystick.axes = [0,0]
      dat.testJoystick.buttons = [False]
      pm.send('testJoystick', dat)
    time.sleep(0.1)

  if __name__ == '__main__':
    threading.Thread(target=handle_timeout, daemon=True).start()
    app.run(host="0.0.0.0")
  
keep add keep keep keep keep
 body: web joystick handle timeout
tools/joystick/web.py