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:
@@ -868,7 +868,7 @@ static void Emscripten_HandlePenEnter(SDL_WindowData *window_data, const Emscrip
|
||||
|
||||
SDL_PenID pen = SDL_FindPenByHandle((void *) (size_t) 1); // something > 0 for the single pen handle.
|
||||
if (pen) {
|
||||
SDL_SendPenProximity(0, pen, window_data->window, true);
|
||||
SDL_SendPenProximity(0, pen, window_data->window, true, true);
|
||||
} else {
|
||||
// Web browsers offer almost none of this information as specifics, but can without warning offer any of these specific things.
|
||||
SDL_PenInfo peninfo;
|
||||
@@ -902,7 +902,7 @@ static void Emscripten_HandlePenLeave(SDL_WindowData *window_data, const Emscrip
|
||||
const SDL_PenID pen = SDL_FindPenByHandle((void *) (size_t) 1); // something > 0 for the single pen handle.
|
||||
if (pen) {
|
||||
Emscripten_UpdatePointerFromEvent(window_data, event); // last data updates?
|
||||
SDL_SendPenProximity(0, pen, window_data->window, false);
|
||||
SDL_SendPenProximity(0, pen, window_data->window, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user