mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #6882 from vnen/mouse-mode
Fix the hiding of mouse cursor before interaction
This commit is contained in:
commit
7740b3912c
@ -1366,13 +1366,16 @@ void OS_Windows::set_mouse_mode(MouseMode p_mode) {
|
|||||||
POINT pos = { (int) center.x, (int) center.y };
|
POINT pos = { (int) center.x, (int) center.y };
|
||||||
ClientToScreen(hWnd, &pos);
|
ClientToScreen(hWnd, &pos);
|
||||||
SetCursorPos(pos.x, pos.y);
|
SetCursorPos(pos.x, pos.y);
|
||||||
ShowCursor(false);
|
|
||||||
} else {
|
} else {
|
||||||
ShowCursor(true);
|
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
ClipCursor(NULL);
|
ClipCursor(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p_mode == MOUSE_MODE_CAPTURED || p_mode == MOUSE_MODE_HIDDEN) {
|
||||||
|
hCursor = SetCursor(NULL);
|
||||||
|
} else {
|
||||||
|
SetCursor(hCursor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OS_Windows::MouseMode OS_Windows::get_mouse_mode() const{
|
OS_Windows::MouseMode OS_Windows::get_mouse_mode() const{
|
||||||
|
Loading…
Reference in New Issue
Block a user