In this modified version, I removed the elif event.type == hapi.pygame.MOUSEBUTTONUP block and the draging = False line from that block. Additionally, I removed the try, except, else, and finally blocks, as they weren't necessary for the suggested modification.
Now, the pygame.QUIT event is directly handled in the event loop, and if that event is detected, it sets hapi.is_running to False and breaks out of the loop. This should provide a cleaner and more direct exit mechanism when the quit button is pressed.
In this modified version, I removed the elif event.type == hapi.pygame.MOUSEBUTTONUP block and the draging = False line from that block. Additionally, I removed the try, except, else, and finally blocks, as they weren't necessary for the suggested modification.
Now, the pygame.QUIT event is directly handled in the event loop, and if that event is detected, it sets hapi.is_running to False and breaks out of the loop. This should provide a cleaner and more direct exit mechanism when the quit button is pressed.