From c1987d11fd473301f021aa3a01c7a814de47b74a Mon Sep 17 00:00:00 2001 From: Lightning_A Date: Tue, 27 Jul 2021 06:56:33 -0600 Subject: [PATCH] Bind `Input.mouse_mode` as a property --- core/input/input.cpp | 2 ++ doc/classes/Input.xml | 18 +++++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/core/input/input.cpp b/core/input/input.cpp index c3b43a4274..2b9c4cc63c 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -135,6 +135,8 @@ void Input::_bind_methods() { ClassDB::bind_method(D_METHOD("set_use_accumulated_input", "enable"), &Input::set_use_accumulated_input); ClassDB::bind_method(D_METHOD("flush_buffered_events"), &Input::flush_buffered_events); + ADD_PROPERTY(PropertyInfo(Variant::INT, "mouse_mode"), "set_mouse_mode", "get_mouse_mode"); + BIND_ENUM_CONSTANT(MOUSE_MODE_VISIBLE); BIND_ENUM_CONSTANT(MOUSE_MODE_HIDDEN); BIND_ENUM_CONSTANT(MOUSE_MODE_CAPTURED); diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 1fded42db2..ed77d6febb 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -160,12 +160,6 @@ Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. - - - - Returns the mouse mode. See the constants for more information. - - @@ -330,13 +324,6 @@ [b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS. - - - - - Sets the mouse mode. See the constants for more information. - - @@ -379,6 +366,11 @@ + + + Sets the visiblity/constraints of the mouse cursor. See [enum MouseMode] for more details. + +