-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
- Originally reported in SDL3: external tablet driver bug with high precision mouse enabled ppy/osu#28223
SDL has special logic to convert raw absolute mouse (i.e. tablet) input to relative mouse motion. This tablet pen input never generates SDL_PenMotionEvent
s.
SDL/src/video/windows/SDL_windowsevents.c
Lines 650 to 658 in 31f9cb4
} else { | |
const int MAXIMUM_TABLET_RELATIVE_MOTION = 32; | |
if (SDL_abs(relX) > MAXIMUM_TABLET_RELATIVE_MOTION || | |
SDL_abs(relY) > MAXIMUM_TABLET_RELATIVE_MOTION) { | |
/* Ignore this motion, probably a pen lift and drop */ | |
} else { | |
SDL_SendMouseMotion(timestamp, window, mouseID, true, (float)relX, (float)relY); | |
} | |
} |
I would expect this pen to mouse logic to only fire when SDL_HINT_PEN_MOUSE_EVENTS is enabled. I would also expect to get the usual SDL_PenMotionEvent for this pen input.
This issue only affects tablet drivers that generate absolute mouse input. (Example: Wacom drivers with windows ink disabled, OpenTabletDriver, hawku Tablet Driver.) Tablet drivers that generate windows ink events work as expected via WM_POINTER
& co. handling. When relative mouse mode is disabled, absolute tablet events are reported as absolute mouse input, which is not ideal, but is not really a problem as it's mapping absolute to absolute.