|
@@ -225,7 +225,6 @@ bool OS_Windows::can_draw() const {
|
|
|
|
|
|
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) {
|
|
|
|
|
|
-#if WINVER >= 0x0601 // for windows 7
|
|
|
|
// Defensive
|
|
// Defensive
|
|
if (touch_state.has(idx) == p_pressed)
|
|
if (touch_state.has(idx) == p_pressed)
|
|
return;
|
|
return;
|
|
@@ -235,7 +234,6 @@ void OS_Windows::_touch_event(bool p_pressed, float p_x, float p_y, int idx) {
|
|
} else {
|
|
} else {
|
|
touch_state.erase(idx);
|
|
touch_state.erase(idx);
|
|
}
|
|
}
|
|
-#endif
|
|
|
|
|
|
|
|
Ref<InputEventScreenTouch> event;
|
|
Ref<InputEventScreenTouch> event;
|
|
event.instance();
|
|
event.instance();
|
|
@@ -250,7 +248,6 @@ void OS_Windows::_touch_event(bool p_pressed, float p_x, float p_y, int idx) {
|
|
|
|
|
|
void OS_Windows::_drag_event(float p_x, float p_y, int idx) {
|
|
void OS_Windows::_drag_event(float p_x, float p_y, int idx) {
|
|
|
|
|
|
-#if WINVER >= 0x0601 // for windows 7
|
|
|
|
Map<int, Vector2>::Element *curr = touch_state.find(idx);
|
|
Map<int, Vector2>::Element *curr = touch_state.find(idx);
|
|
// Defensive
|
|
// Defensive
|
|
if (!curr)
|
|
if (!curr)
|
|
@@ -260,7 +257,6 @@ void OS_Windows::_drag_event(float p_x, float p_y, int idx) {
|
|
return;
|
|
return;
|
|
|
|
|
|
curr->get() = Vector2(p_x, p_y);
|
|
curr->get() = Vector2(p_x, p_y);
|
|
-#endif
|
|
|
|
|
|
|
|
Ref<InputEventScreenDrag> event;
|
|
Ref<InputEventScreenDrag> event;
|
|
event.instance();
|
|
event.instance();
|
|
@@ -290,13 +286,13 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
if (mouse_mode == MOUSE_MODE_CAPTURED || mouse_mode == MOUSE_MODE_CONFINED) {
|
|
if (mouse_mode == MOUSE_MODE_CAPTURED || mouse_mode == MOUSE_MODE_CONFINED) {
|
|
ReleaseCapture();
|
|
ReleaseCapture();
|
|
}
|
|
}
|
|
-#if WINVER >= 0x0601 // for windows 7
|
|
|
|
|
|
+
|
|
// Release every touch to avoid sticky points
|
|
// Release every touch to avoid sticky points
|
|
for (Map<int, Vector2>::Element *E = touch_state.front(); E; E = E->next()) {
|
|
for (Map<int, Vector2>::Element *E = touch_state.front(); E; E = E->next()) {
|
|
_touch_event(false, E->get().x, E->get().y, E->key());
|
|
_touch_event(false, E->get().x, E->get().y, E->key());
|
|
}
|
|
}
|
|
touch_state.clear();
|
|
touch_state.clear();
|
|
-#endif
|
|
|
|
|
|
+
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case WM_ACTIVATE: // Watch For Window Activate Message
|
|
case WM_ACTIVATE: // Watch For Window Activate Message
|
|
@@ -700,7 +696,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
print_line("input lang change");
|
|
print_line("input lang change");
|
|
} break;
|
|
} break;
|
|
|
|
|
|
-#if WINVER >= 0x0601 // for windows 7
|
|
|
|
case WM_TOUCH: {
|
|
case WM_TOUCH: {
|
|
|
|
|
|
BOOL bHandled = FALSE;
|
|
BOOL bHandled = FALSE;
|
|
@@ -734,7 +729,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
|
|
|
|
} break;
|
|
} break;
|
|
|
|
|
|
-#endif
|
|
|
|
case WM_DEVICECHANGE: {
|
|
case WM_DEVICECHANGE: {
|
|
|
|
|
|
joypad->probe_joypads();
|
|
joypad->probe_joypads();
|
|
@@ -1118,9 +1112,7 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
|
|
tme.dwHoverTime = HOVER_DEFAULT;
|
|
tme.dwHoverTime = HOVER_DEFAULT;
|
|
TrackMouseEvent(&tme);
|
|
TrackMouseEvent(&tme);
|
|
|
|
|
|
-#if WINVER >= 0x0601 // for windows 7
|
|
|
|
- RegisterTouchWindow(hWnd, 0); // Windows 7
|
|
|
|
-#endif
|
|
|
|
|
|
+ RegisterTouchWindow(hWnd, 0);
|
|
|
|
|
|
_ensure_user_data_dir();
|
|
_ensure_user_data_dir();
|
|
|
|
|
|
@@ -1234,9 +1226,7 @@ void OS_Windows::finalize() {
|
|
|
|
|
|
memdelete(joypad);
|
|
memdelete(joypad);
|
|
memdelete(input);
|
|
memdelete(input);
|
|
-#if WINVER >= 0x0601 // for windows 7
|
|
|
|
touch_state.clear();
|
|
touch_state.clear();
|
|
-#endif
|
|
|
|
|
|
|
|
visual_server->finish();
|
|
visual_server->finish();
|
|
memdelete(visual_server);
|
|
memdelete(visual_server);
|