3838#include " core/templates/rb_set.h"
3939#include " core/variant/typed_array.h"
4040
41+ namespace InputClassEnums {
42+ // Keep synced with "DisplayServer::MouseMode" enum.
43+ enum MouseMode : int {
44+ MOUSE_MODE_VISIBLE,
45+ MOUSE_MODE_HIDDEN,
46+ MOUSE_MODE_CAPTURED,
47+ MOUSE_MODE_CONFINED,
48+ MOUSE_MODE_CONFINED_HIDDEN,
49+ MOUSE_MODE_MAX,
50+ };
51+
52+ #undef CursorShape
53+ enum CursorShape : int {
54+ CURSOR_ARROW,
55+ CURSOR_IBEAM,
56+ CURSOR_POINTING_HAND,
57+ CURSOR_CROSS,
58+ CURSOR_WAIT,
59+ CURSOR_BUSY,
60+ CURSOR_DRAG,
61+ CURSOR_CAN_DROP,
62+ CURSOR_FORBIDDEN,
63+ CURSOR_VSIZE,
64+ CURSOR_HSIZE,
65+ CURSOR_BDIAGSIZE,
66+ CURSOR_FDIAGSIZE,
67+ CURSOR_MOVE,
68+ CURSOR_VSPLIT,
69+ CURSOR_HSPLIT,
70+ CURSOR_HELP,
71+ CURSOR_MAX
72+ };
73+ } // namespace InputClassEnums
74+
4175class Input : public Object {
4276 GDCLASS (Input, Object);
4377 _THREAD_SAFE_CLASS_
@@ -47,37 +81,8 @@ class Input : public Object {
4781 static constexpr uint64_t MAX_EVENT = 32 ;
4882
4983public:
50- // Keep synced with "DisplayServer::MouseMode" enum.
51- enum MouseMode {
52- MOUSE_MODE_VISIBLE,
53- MOUSE_MODE_HIDDEN,
54- MOUSE_MODE_CAPTURED,
55- MOUSE_MODE_CONFINED,
56- MOUSE_MODE_CONFINED_HIDDEN,
57- MOUSE_MODE_MAX,
58- };
59-
60- #undef CursorShape
61- enum CursorShape {
62- CURSOR_ARROW,
63- CURSOR_IBEAM,
64- CURSOR_POINTING_HAND,
65- CURSOR_CROSS,
66- CURSOR_WAIT,
67- CURSOR_BUSY,
68- CURSOR_DRAG,
69- CURSOR_CAN_DROP,
70- CURSOR_FORBIDDEN,
71- CURSOR_VSIZE,
72- CURSOR_HSIZE,
73- CURSOR_BDIAGSIZE,
74- CURSOR_FDIAGSIZE,
75- CURSOR_MOVE,
76- CURSOR_VSPLIT,
77- CURSOR_HSPLIT,
78- CURSOR_HELP,
79- CURSOR_MAX
80- };
84+ using MouseMode = InputClassEnums::MouseMode;
85+ using CursorShape = InputClassEnums::CursorShape;
8186
8287 class JoypadFeatures {
8388 public:
@@ -195,7 +200,7 @@ class Input : public Object {
195200
196201 int fallback_mapping = -1 ; // Index of the guid in map_db.
197202
198- CursorShape default_shape = CURSOR_ARROW;
203+ CursorShape default_shape = CursorShape:: CURSOR_ARROW;
199204
200205 enum JoyType {
201206 TYPE_BUTTON,
@@ -382,7 +387,7 @@ class Input : public Object {
382387 CursorShape get_default_cursor_shape () const ;
383388 void set_default_cursor_shape (CursorShape p_shape);
384389 CursorShape get_current_cursor_shape () const ;
385- void set_custom_mouse_cursor (const Ref<Resource> &p_cursor, CursorShape p_shape = Input::CURSOR_ARROW, const Vector2 &p_hotspot = Vector2());
390+ void set_custom_mouse_cursor (const Ref<Resource> &p_cursor, CursorShape p_shape = Input::CursorShape:: CURSOR_ARROW, const Vector2 &p_hotspot = Vector2());
386391
387392 void parse_mapping (const String &p_mapping);
388393 void joy_button (int p_device, JoyButton p_button, bool p_pressed);
0 commit comments