summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/SCsub11
-rw-r--r--platform/windows/os_windows.cpp8
2 files changed, 12 insertions, 7 deletions
diff --git a/platform/windows/SCsub b/platform/windows/SCsub
index 53ed3bf887..586533e817 100644
--- a/platform/windows/SCsub
+++ b/platform/windows/SCsub
@@ -7,6 +7,7 @@ from platform_methods import run_in_subprocess
import platform_windows_builders
common_win = [
+ "godot_win.cpp",
"context_gl_win.cpp",
"crash_handler_win.cpp",
"os_windows.cpp",
@@ -17,17 +18,17 @@ common_win = [
"windows_terminal_logger.cpp"
]
-restarget = "godot_res" + env["OBJSUFFIX"]
+res_file = 'godot_res.rc'
-obj = env.RES(restarget, 'godot_res.rc')
+res_target = "godot_res" + env["OBJSUFFIX"]
-common_win.append(obj)
+res_obj = env.RES(res_target, res_file)
-prog = env.add_program('#bin/godot', ['godot_win.cpp'] + common_win, PROGSUFFIX=env["PROGSUFFIX"])
+prog = env.add_program('#bin/godot', common_win + res_obj, PROGSUFFIX=env["PROGSUFFIX"])
# Microsoft Visual Studio Project Generation
if env['vsproj']:
- env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"]
+ env.vs_srcs = env.vs_srcs + ["platform/windows/" + res_file]
for x in common_win:
env.vs_srcs = env.vs_srcs + ["platform/windows/" + str(x)]
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 7009df8e57..4ca6f36629 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -249,7 +249,11 @@ bool OS_Windows::can_draw() const {
#define MI_WP_SIGNATURE 0xFF515700
#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)
+// 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) {
@@ -469,7 +473,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (input->is_emulating_mouse_from_touch()) {
// Universal translation enabled; ignore OS translation
LPARAM extra = GetMessageExtraInfo();
- if (IsPenEvent(extra)) {
+ if (IsTouchEvent(extra)) {
break;
}
}
@@ -560,7 +564,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (input->is_emulating_mouse_from_touch()) {
// Universal translation enabled; ignore OS translations for left button
LPARAM extra = GetMessageExtraInfo();
- if (IsPenEvent(extra)) {
+ if (IsTouchEvent(extra)) {
break;
}
}