From 1005a56e5a27fb7f491d280d5aff6fe88691365c Mon Sep 17 00:00:00 2001 From: Ilija Boshkov Date: Wed, 25 Jan 2017 19:21:41 +0100 Subject: Added focus tracking in X11 and Windows classes, added new confined mouse mode (#7162) --- core/os/input.cpp | 3 ++- core/os/input.h | 3 ++- core/os/os.h | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'core/os') diff --git a/core/os/input.cpp b/core/os/input.cpp index e53aa82b13..4e7b037453 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -38,7 +38,7 @@ Input *Input::get_singleton() { } void Input::set_mouse_mode(MouseMode p_mode) { - ERR_FAIL_INDEX(p_mode,3); + ERR_FAIL_INDEX(p_mode,4); OS::get_singleton()->set_mouse_mode((OS::MouseMode)p_mode); } @@ -87,6 +87,7 @@ void Input::_bind_methods() { BIND_CONSTANT( MOUSE_MODE_VISIBLE ); BIND_CONSTANT( MOUSE_MODE_HIDDEN ); BIND_CONSTANT( MOUSE_MODE_CAPTURED ); + BIND_CONSTANT( MOUSE_MODE_CONFINED ); ADD_SIGNAL( MethodInfo("joy_connection_changed", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "connected")) ); } diff --git a/core/os/input.h b/core/os/input.h index 82c7a80d3f..2cea154a50 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -47,7 +47,8 @@ public: enum MouseMode { MOUSE_MODE_VISIBLE, MOUSE_MODE_HIDDEN, - MOUSE_MODE_CAPTURED + MOUSE_MODE_CAPTURED, + MOUSE_MODE_CONFINED }; void set_mouse_mode(MouseMode p_mode); diff --git a/core/os/os.h b/core/os/os.h index ea03481a92..42c7c18b0c 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -131,7 +131,8 @@ public: enum MouseMode { MOUSE_MODE_VISIBLE, MOUSE_MODE_HIDDEN, - MOUSE_MODE_CAPTURED + MOUSE_MODE_CAPTURED, + MOUSE_MODE_CONFINED }; virtual void set_mouse_mode(MouseMode p_mode); -- cgit v1.2.3