trezor-firmware icon indicating copy to clipboard operation
trezor-firmware copied to clipboard

fix(core): fix mouse event processing in the simulator

Open cepetr opened this issue 1 year ago • 0 comments

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:

  1. The TOUCH_START event is generated only if SDL_MOUSEDOWN event was detected inside the simulator display area
  2. When holding the mouse button and moving, TOUCH_MOVE is generated
  3. When holding the mouse button down and leaving the display area, the TOUCH_END event is simulated. The x,y coordinates are same as in the last TOUCH_MOVE event

cepetr avatar Jan 30 '24 08:01 cepetr