mirror of
https://github.com/encounter/SDL.git
synced 2025-12-21 18:59:15 +00:00
Add SDL_TouchDeviceType enum and SDL_GetTouchDeviceType(SDL_TouchID id).
Touch device types include SDL_TOUCH_DEVICE_DIRECT (a touch screen with window-relative coordinates for touches), SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE (a trackpad-style device with absolute device coordinates), and SDL_TOUCH_DEVICE_INDIRECT_RELATIVE (a trackpad-style device with screen cursor-relative coordinates). Phone screens are an example of a direct device type. Mac trackpads are the indirect-absolute touch device type. The Apple TV remote is an indirect-relative touch device type.
This commit is contained in:
@@ -932,7 +932,11 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
PTOUCHINPUT input = &inputs[i];
|
||||
|
||||
const SDL_TouchID touchId = (SDL_TouchID)((size_t)input->hSource);
|
||||
if (SDL_AddTouch(touchId, "") < 0) {
|
||||
|
||||
/* TODO: Can we use GetRawInputDeviceInfo and HID info to
|
||||
determine if this is a direct or indirect touch device?
|
||||
*/
|
||||
if (SDL_AddTouch(touchId, SDL_TOUCH_DEVICE_DIRECT, "") < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user