33 #include "os/thread_safe.h" 34 #include "os/main_loop.h" 40 static Input *singleton;
44 static void _bind_methods();
53 void set_mouse_mode(MouseMode p_mode);
54 MouseMode get_mouse_mode()
const;
56 static Input *get_singleton();
58 virtual bool is_key_pressed(
int p_scancode)=0;
59 virtual bool is_mouse_button_pressed(
int p_button)=0;
60 virtual bool is_joy_button_pressed(
int p_device,
int p_button)=0;
61 virtual bool is_action_pressed(
const StringName& p_action)=0;
63 virtual float get_joy_axis(
int p_device,
int p_axis)=0;
64 virtual String get_joy_name(
int p_idx)=0;
65 virtual void joy_connection_changed(
int p_idx,
bool p_connected,
String p_name,
String p_guid)=0;
66 virtual void add_joy_mapping(
String p_mapping,
bool p_update_existing=
false)=0;
67 virtual void remove_joy_mapping(
String p_guid)=0;
68 virtual bool is_joy_known(
int p_device)=0;
69 virtual String get_joy_guid(
int p_device)
const=0;
71 virtual Point2 get_mouse_pos()
const=0;
72 virtual Point2 get_mouse_speed()
const=0;
73 virtual int get_mouse_button_mask()
const=0;
75 virtual void warp_mouse_pos(
const Vector2& p_to)=0;
77 virtual Vector3 get_accelerometer()=0;
79 virtual void action_press(
const StringName& p_action)=0;
80 virtual void action_release(
const StringName& p_action)=0;
84 virtual bool is_emulating_touchscreen()
const=0;
86 virtual void set_custom_mouse_cursor(
const RES& p_cursor,
const Vector2& p_hotspot=
Vector2())=0;
87 virtual void set_mouse_in_window(
bool p_in_window)=0;
92 VARIANT_ENUM_CAST(Input::MouseMode);
Definition: string_db.h:48