mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-23 00:35:34 +02:00
Guarantee that pens are in proximity before motion and button events
This also delays pen proximity out events to make sure that the pen is really gone before delivering them. On Android, you get a HOVER_EXIT event when the pen contacts the surface, which we don't want to treat as the pen leaving proximity.
This commit is contained in:
@@ -78,12 +78,12 @@ void Android_OnPen(SDL_Window *window, int pen_id_in, SDL_PenDeviceType device_t
|
||||
// we don't compare tip flags above because MotionEvent.getButtonState doesn't return stylus tip/eraser state.
|
||||
switch (action) {
|
||||
case ACTION_HOVER_ENTER:
|
||||
SDL_SendPenProximity(0, pen, window, true);
|
||||
SDL_SendPenProximity(0, pen, window, true, true);
|
||||
break;
|
||||
|
||||
case ACTION_CANCEL:
|
||||
case ACTION_HOVER_EXIT: // strictly speaking, this can mean both "proximity out" and "left the View" but close enough.
|
||||
SDL_SendPenProximity(0, pen, window, false);
|
||||
SDL_SendPenProximity(0, pen, window, false, false);
|
||||
break;
|
||||
|
||||
case ACTION_DOWN:
|
||||
|
||||
Reference in New Issue
Block a user