mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-22 21:35:30 +00:00
Differentiate between Windows Ink (pen) and regular touch input
SDL2 backport of https://github.com/libsdl-org/SDL/pull/5926
This commit is contained in:
parent
867d8643d7
commit
cfecc569b5
|
@ -99,6 +99,9 @@
|
|||
#ifndef WM_GETDPISCALEDSIZE
|
||||
#define WM_GETDPISCALEDSIZE 0x02E4
|
||||
#endif
|
||||
#ifndef TOUCHEVENTF_PEN
|
||||
#define TOUCHEVENTF_PEN 0x0040
|
||||
#endif
|
||||
|
||||
#ifndef IS_HIGH_SURROGATE
|
||||
#define IS_HIGH_SURROGATE(x) (((x) >= 0xd800) && ((x) <= 0xdbff))
|
||||
|
@ -1396,7 +1399,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
/* 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) {
|
||||
if (SDL_AddTouch(touchId, SDL_TOUCH_DEVICE_DIRECT, (input->dwFlags & TOUCHEVENTF_PEN) == TOUCHEVENTF_PEN ? "pen" : "touch") < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue