diff options
Diffstat (limited to 'platform/x11/os_x11.cpp')
-rw-r--r-- | platform/x11/os_x11.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index e0dc594441..4c45fcfaaf 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -461,6 +461,19 @@ void OS_X11::set_mouse_mode(MouseMode p_mode) { } +void OS_X11::warp_mouse_pos(const Point2& p_to) { + + if (mouse_mode==MOUSE_MODE_CAPTURED) { + + last_mouse_pos=p_to; + } else { + + XWarpPointer(x11_display, None, x11_window, + 0,0,0,0, (int)p_to.x, (int)p_to.y); + } + +} + OS::MouseMode OS_X11::get_mouse_mode() const { return mouse_mode; |