Fix multitouch input not working on certain devices on Windows
Fixes #20474.
This commit is contained in:
parent
a1019c2c82
commit
28019c71a6
|
@ -249,7 +249,11 @@ bool OS_Windows::can_draw() const {
|
||||||
|
|
||||||
#define MI_WP_SIGNATURE 0xFF515700
|
#define MI_WP_SIGNATURE 0xFF515700
|
||||||
#define SIGNATURE_MASK 0xFFFFFF00
|
#define SIGNATURE_MASK 0xFFFFFF00
|
||||||
|
// Keeping the name suggested by Microsoft, but this macro really answers:
|
||||||
|
// Is this mouse event emulated from touch or pen input?
|
||||||
#define IsPenEvent(dw) (((dw)&SIGNATURE_MASK) == MI_WP_SIGNATURE)
|
#define IsPenEvent(dw) (((dw)&SIGNATURE_MASK) == MI_WP_SIGNATURE)
|
||||||
|
// This one tells whether the event comes from touchscreen (and not from pen)
|
||||||
|
#define IsTouchEvent(dw) (IsPenEvent(dw) && ((dw)&0x80))
|
||||||
|
|
||||||
void OS_Windows::_touch_event(bool p_pressed, float p_x, float p_y, int idx) {
|
void OS_Windows::_touch_event(bool p_pressed, float p_x, float p_y, int idx) {
|
||||||
|
|
||||||
|
@ -469,7 +473,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
if (input->is_emulating_mouse_from_touch()) {
|
if (input->is_emulating_mouse_from_touch()) {
|
||||||
// Universal translation enabled; ignore OS translation
|
// Universal translation enabled; ignore OS translation
|
||||||
LPARAM extra = GetMessageExtraInfo();
|
LPARAM extra = GetMessageExtraInfo();
|
||||||
if (IsPenEvent(extra)) {
|
if (IsTouchEvent(extra)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -560,7 +564,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
if (input->is_emulating_mouse_from_touch()) {
|
if (input->is_emulating_mouse_from_touch()) {
|
||||||
// Universal translation enabled; ignore OS translations for left button
|
// Universal translation enabled; ignore OS translations for left button
|
||||||
LPARAM extra = GetMessageExtraInfo();
|
LPARAM extra = GetMessageExtraInfo();
|
||||||
if (IsPenEvent(extra)) {
|
if (IsTouchEvent(extra)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue