trezor-firmware
trezor-firmware copied to clipboard
fix(core): fix mouse event processing in the simulator
This pull request contains a fix for #3506 issue.
The touch_read() function has been refactored to merge successive `SDL_MOTION`` events into one.
The behavior of the function was made more clearer and more precise:
- The
TOUCH_STARTevent is generated only ifSDL_MOUSEDOWNevent was detected inside the simulator display area - When holding the mouse button and moving,
TOUCH_MOVEis generated - When holding the mouse button down and leaving the display area, the
TOUCH_ENDevent is simulated. The x,y coordinates are same as in the lastTOUCH_MOVEevent