changed the busy loop to a an event loop
app will wait for joystick events,
if there is any then it will take action
if not, it will not waste cpu cycles