Add opt-in support for trackpad touch events. Add touch device types.

- Add new touch device type enum ("touchscreen", "touchpad", "touchpadrelative"). Coordinates for touchscreens are window-relative DPI-scaled pixels, and coordinates for touchpads are normalized [0, 1] values.
- Add new devicetype enum and ismouse boolean params to touch callbacks.
- Add love.touch.getDeviceType(touchid), love.touch.isMouse(touchid), and optional device type filter param for love.touch.getTouches.
- Add t.trackpadtouch boolean (defaults to false) to love.conf. Trackpad touch events will not be generated unless it's enabled.

Currently the trackpadtouch setting only works on macOS.

Resolves #1633.
Resolves #2093.
This commit is contained in:
Sasha Szpakowski
2024-12-25 13:15:17 -04:00
parent aa93494f54
commit 639580cbd1
11 changed files with 216 additions and 56 deletions
+1
View File
@@ -1182,6 +1182,7 @@ target_link_libraries(love_timer PUBLIC
#
add_library(love_touch_root STATIC
src/modules/touch/Touch.cpp
src/modules/touch/Touch.h
src/modules/touch/wrap_Touch.cpp
src/modules/touch/wrap_Touch.h