2016-06-18 12:46:12 +00:00
|
|
|
/*************************************************************************/
|
2020-04-28 13:19:37 +00:00
|
|
|
/* input.h */
|
2016-06-18 12:46:12 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 12:16:55 +00:00
|
|
|
/* https://godotengine.org */
|
2016-06-18 12:46:12 +00:00
|
|
|
/*************************************************************************/
|
2020-01-01 10:16:22 +00:00
|
|
|
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
2016-06-18 12:46:12 +00:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
2018-01-04 23:50:27 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
#ifndef INPUT_H
|
|
|
|
#define INPUT_H
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-03-04 16:36:09 +00:00
|
|
|
#include "core/input/input_event.h"
|
2020-03-01 22:14:37 +00:00
|
|
|
#include "core/object.h"
|
|
|
|
#include "core/os/thread_safe.h"
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-04-28 13:19:37 +00:00
|
|
|
class Input : public Object {
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-04-28 13:19:37 +00:00
|
|
|
GDCLASS(Input, Object);
|
2015-09-24 21:06:15 +00:00
|
|
|
_THREAD_SAFE_CLASS_
|
|
|
|
|
2020-04-28 13:19:37 +00:00
|
|
|
static Input *singleton;
|
2020-03-01 22:14:37 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum MouseMode {
|
|
|
|
MOUSE_MODE_VISIBLE,
|
|
|
|
MOUSE_MODE_HIDDEN,
|
|
|
|
MOUSE_MODE_CAPTURED,
|
|
|
|
MOUSE_MODE_CONFINED
|
|
|
|
};
|
|
|
|
|
|
|
|
#undef CursorShape
|
|
|
|
enum CursorShape {
|
|
|
|
CURSOR_ARROW,
|
|
|
|
CURSOR_IBEAM,
|
|
|
|
CURSOR_POINTING_HAND,
|
|
|
|
CURSOR_CROSS,
|
|
|
|
CURSOR_WAIT,
|
|
|
|
CURSOR_BUSY,
|
|
|
|
CURSOR_DRAG,
|
|
|
|
CURSOR_CAN_DROP,
|
|
|
|
CURSOR_FORBIDDEN,
|
|
|
|
CURSOR_VSIZE,
|
|
|
|
CURSOR_HSIZE,
|
|
|
|
CURSOR_BDIAGSIZE,
|
|
|
|
CURSOR_FDIAGSIZE,
|
|
|
|
CURSOR_MOVE,
|
|
|
|
CURSOR_VSPLIT,
|
|
|
|
CURSOR_HSPLIT,
|
|
|
|
CURSOR_HELP,
|
|
|
|
CURSOR_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
enum HatMask {
|
|
|
|
HAT_MASK_CENTER = 0,
|
|
|
|
HAT_MASK_UP = 1,
|
|
|
|
HAT_MASK_RIGHT = 2,
|
|
|
|
HAT_MASK_DOWN = 4,
|
|
|
|
HAT_MASK_LEFT = 8,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum HatDir {
|
|
|
|
HAT_UP,
|
|
|
|
HAT_RIGHT,
|
|
|
|
HAT_DOWN,
|
|
|
|
HAT_LEFT,
|
|
|
|
HAT_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
JOYPADS_MAX = 16,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct JoyAxis {
|
|
|
|
int min;
|
|
|
|
float value;
|
|
|
|
};
|
|
|
|
|
2020-03-04 16:36:09 +00:00
|
|
|
typedef void (*EventDispatchFunc)(const Ref<InputEvent> &p_event);
|
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
private:
|
2015-09-24 21:06:15 +00:00
|
|
|
int mouse_button_mask;
|
2016-09-01 21:58:52 +00:00
|
|
|
|
2015-09-24 21:06:15 +00:00
|
|
|
Set<int> keys_pressed;
|
|
|
|
Set<int> joy_buttons_pressed;
|
2017-03-05 15:44:50 +00:00
|
|
|
Map<int, float> _joy_axis;
|
2016-09-01 21:58:52 +00:00
|
|
|
//Map<StringName,int> custom_action_press;
|
2016-11-23 12:32:44 +00:00
|
|
|
Vector3 gravity;
|
2015-09-24 21:06:15 +00:00
|
|
|
Vector3 accelerometer;
|
2016-05-27 17:29:37 +00:00
|
|
|
Vector3 magnetometer;
|
2016-07-15 07:31:34 +00:00
|
|
|
Vector3 gyroscope;
|
2015-09-24 21:06:15 +00:00
|
|
|
Vector2 mouse_pos;
|
2020-03-01 22:14:37 +00:00
|
|
|
int64_t mouse_window;
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2016-09-01 21:58:52 +00:00
|
|
|
struct Action {
|
2017-09-30 14:19:07 +00:00
|
|
|
uint64_t physics_frame;
|
2016-09-01 21:58:52 +00:00
|
|
|
uint64_t idle_frame;
|
|
|
|
bool pressed;
|
2018-02-21 21:06:34 +00:00
|
|
|
float strength;
|
2016-09-01 21:58:52 +00:00
|
|
|
};
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
Map<StringName, Action> action_state;
|
2016-09-01 21:58:52 +00:00
|
|
|
|
2018-02-24 02:04:30 +00:00
|
|
|
bool emulate_touch_from_mouse;
|
|
|
|
bool emulate_mouse_from_touch;
|
|
|
|
|
|
|
|
int mouse_from_touch_index;
|
2016-06-15 05:25:35 +00:00
|
|
|
|
2015-09-24 21:06:15 +00:00
|
|
|
struct SpeedTrack {
|
|
|
|
|
|
|
|
uint64_t last_tick;
|
|
|
|
Vector2 speed;
|
|
|
|
Vector2 accum;
|
|
|
|
float accum_t;
|
|
|
|
float min_ref_frame;
|
|
|
|
float max_ref_frame;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void update(const Vector2 &p_delta_p);
|
2015-09-24 21:06:15 +00:00
|
|
|
void reset();
|
|
|
|
SpeedTrack();
|
|
|
|
};
|
|
|
|
|
2017-01-08 20:05:51 +00:00
|
|
|
struct Joypad {
|
2015-12-18 18:15:32 +00:00
|
|
|
StringName name;
|
|
|
|
StringName uid;
|
2016-07-05 12:07:46 +00:00
|
|
|
bool connected;
|
2016-01-24 04:11:59 +00:00
|
|
|
bool last_buttons[JOY_BUTTON_MAX + 19]; //apparently SDL specifies 35 possible buttons on android
|
2015-12-18 18:15:32 +00:00
|
|
|
float last_axis[JOY_AXIS_MAX];
|
|
|
|
float filter;
|
|
|
|
int last_hat;
|
|
|
|
int mapping;
|
|
|
|
int hat_current;
|
|
|
|
|
2017-01-08 20:05:51 +00:00
|
|
|
Joypad() {
|
2015-12-18 18:15:32 +00:00
|
|
|
for (int i = 0; i < JOY_AXIS_MAX; i++) {
|
|
|
|
|
|
|
|
last_axis[i] = 0.0f;
|
|
|
|
}
|
2016-01-24 04:11:59 +00:00
|
|
|
for (int i = 0; i < JOY_BUTTON_MAX + 19; i++) {
|
2015-12-18 18:15:32 +00:00
|
|
|
|
|
|
|
last_buttons[i] = false;
|
|
|
|
}
|
2016-07-05 12:07:46 +00:00
|
|
|
connected = false;
|
2015-12-18 18:15:32 +00:00
|
|
|
last_hat = HAT_MASK_CENTER;
|
|
|
|
filter = 0.01f;
|
2016-01-07 23:40:41 +00:00
|
|
|
mapping = -1;
|
2018-04-19 11:04:41 +00:00
|
|
|
hat_current = 0;
|
2015-12-18 18:15:32 +00:00
|
|
|
}
|
|
|
|
};
|
2015-12-18 05:12:53 +00:00
|
|
|
|
|
|
|
SpeedTrack mouse_speed_track;
|
2018-10-14 15:55:03 +00:00
|
|
|
Map<int, SpeedTrack> touch_speed_track;
|
2017-01-08 20:05:51 +00:00
|
|
|
Map<int, Joypad> joy_names;
|
2016-01-24 17:01:37 +00:00
|
|
|
int fallback_mapping;
|
2018-09-26 09:22:59 +00:00
|
|
|
|
|
|
|
CursorShape default_shape;
|
2017-03-05 15:44:50 +00:00
|
|
|
|
2015-12-18 05:12:53 +00:00
|
|
|
enum JoyType {
|
|
|
|
TYPE_BUTTON,
|
|
|
|
TYPE_AXIS,
|
|
|
|
TYPE_HAT,
|
|
|
|
TYPE_MAX,
|
|
|
|
};
|
|
|
|
|
2020-04-23 09:16:09 +00:00
|
|
|
enum SDLJoyButton {
|
|
|
|
SDL_INVALID_BUTTON = -1,
|
|
|
|
SDL_BUTTON_A,
|
|
|
|
SDL_BUTTON_B,
|
|
|
|
SDL_BUTTON_X,
|
|
|
|
SDL_BUTTON_Y,
|
|
|
|
SDL_BUTTON_BACK,
|
|
|
|
SDL_BUTTON_GUIDE,
|
|
|
|
SDL_BUTTON_START,
|
|
|
|
SDL_BUTTON_LEFTSTICK,
|
|
|
|
SDL_BUTTON_RIGHTSTICK,
|
|
|
|
SDL_BUTTON_LEFTSHOULDER,
|
|
|
|
SDL_BUTTON_RIGHTSHOULDER,
|
|
|
|
SDL_BUTTON_DPAD_UP,
|
|
|
|
SDL_BUTTON_DPAD_DOWN,
|
|
|
|
SDL_BUTTON_DPAD_LEFT,
|
|
|
|
SDL_BUTTON_DPAD_RIGHT,
|
|
|
|
SDL_BUTTON_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
enum SDLJoyAxis {
|
|
|
|
SDL_INVALID_AXIS = -1,
|
|
|
|
SDL_AXIS_LEFTX,
|
|
|
|
SDL_AXIS_LEFTY,
|
|
|
|
SDL_AXIS_RIGHTX,
|
|
|
|
SDL_AXIS_RIGHTY,
|
|
|
|
SDL_AXIS_TRIGGERLEFT,
|
|
|
|
SDL_AXIS_TRIGGERRIGHT,
|
|
|
|
SDL_AXIS_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum JoyAxisRange {
|
|
|
|
NEGATIVE_HALF_AXIS = -1,
|
|
|
|
FULL_AXIS = 0,
|
|
|
|
POSITIVE_HALF_AXIS = 1
|
|
|
|
};
|
|
|
|
|
2015-12-18 05:12:53 +00:00
|
|
|
struct JoyEvent {
|
|
|
|
int type;
|
|
|
|
int index;
|
|
|
|
int value;
|
|
|
|
};
|
|
|
|
|
2020-04-23 09:16:09 +00:00
|
|
|
struct SDLExtendedJoyBind {
|
|
|
|
JoyType inputType;
|
|
|
|
union {
|
|
|
|
int button;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int axis;
|
|
|
|
JoyAxisRange range;
|
|
|
|
} axis;
|
2015-12-18 05:12:53 +00:00
|
|
|
|
2020-04-23 09:16:09 +00:00
|
|
|
struct {
|
|
|
|
int hat;
|
|
|
|
HatMask hat_mask;
|
|
|
|
} hat;
|
|
|
|
|
|
|
|
} input;
|
|
|
|
|
|
|
|
JoyType outputType;
|
|
|
|
union {
|
|
|
|
SDLJoyButton button;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
SDLJoyAxis axis;
|
|
|
|
JoyAxisRange range;
|
|
|
|
} axis;
|
|
|
|
|
|
|
|
} output;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct JoyDeviceMapping {
|
2015-12-18 18:15:32 +00:00
|
|
|
String uid;
|
2016-02-29 15:48:19 +00:00
|
|
|
String name;
|
2020-04-23 09:16:09 +00:00
|
|
|
Vector<SDLExtendedJoyBind> bindings;
|
2015-12-18 18:15:32 +00:00
|
|
|
};
|
2015-12-18 05:12:53 +00:00
|
|
|
|
2015-12-18 18:15:32 +00:00
|
|
|
Vector<JoyDeviceMapping> map_db;
|
2015-12-18 05:12:53 +00:00
|
|
|
|
2020-04-23 09:16:09 +00:00
|
|
|
JoyEvent _get_mapped_button_event(const JoyDeviceMapping &mapping, int p_button);
|
|
|
|
JoyEvent _get_mapped_axis_event(const JoyDeviceMapping &mapping, int p_axis);
|
|
|
|
void _get_mapped_hat_events(const JoyDeviceMapping &mapping, int p_hat, JoyEvent r_events[HAT_MAX]);
|
|
|
|
SDLJoyButton _get_output_button(String output);
|
|
|
|
SDLJoyAxis _get_output_axis(String output);
|
2017-03-26 13:59:13 +00:00
|
|
|
void _button_event(int p_device, int p_index, bool p_pressed);
|
|
|
|
void _axis_event(int p_device, int p_axis, float p_value);
|
2015-12-18 18:15:32 +00:00
|
|
|
float _handle_deadzone(int p_device, int p_axis, float p_value);
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2018-02-24 02:04:30 +00:00
|
|
|
void _parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_emulated);
|
|
|
|
|
2020-03-17 06:33:00 +00:00
|
|
|
List<Ref<InputEvent>> accumulated_events;
|
2019-03-03 22:52:18 +00:00
|
|
|
bool use_accumulated_input;
|
2020-03-03 13:36:29 +00:00
|
|
|
friend class DisplayServer;
|
|
|
|
|
|
|
|
static void (*set_mouse_mode_func)(MouseMode);
|
|
|
|
static MouseMode (*get_mouse_mode_func)();
|
|
|
|
static void (*warp_mouse_func)(const Vector2 &p_to_pos);
|
|
|
|
|
|
|
|
static CursorShape (*get_current_cursor_shape_func)();
|
|
|
|
static void (*set_custom_mouse_cursor_func)(const RES &, CursorShape, const Vector2 &);
|
2019-03-03 22:52:18 +00:00
|
|
|
|
2020-03-04 16:36:09 +00:00
|
|
|
EventDispatchFunc event_dispatch_function;
|
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
protected:
|
2020-04-20 06:06:03 +00:00
|
|
|
struct VibrationInfo {
|
|
|
|
float weak_magnitude;
|
|
|
|
float strong_magnitude;
|
|
|
|
float duration; // Duration in seconds
|
|
|
|
uint64_t timestamp;
|
|
|
|
};
|
|
|
|
|
|
|
|
Map<int, VibrationInfo> joy_vibration;
|
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
static void _bind_methods();
|
|
|
|
|
2015-09-24 21:06:15 +00:00
|
|
|
public:
|
2020-03-01 22:14:37 +00:00
|
|
|
void set_mouse_mode(MouseMode p_mode);
|
|
|
|
MouseMode get_mouse_mode() const;
|
|
|
|
void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;
|
|
|
|
|
2020-04-28 13:19:37 +00:00
|
|
|
static Input *get_singleton();
|
2020-03-01 22:14:37 +00:00
|
|
|
|
|
|
|
bool is_key_pressed(int p_keycode) const;
|
|
|
|
bool is_mouse_button_pressed(int p_button) const;
|
|
|
|
bool is_joy_button_pressed(int p_device, int p_button) const;
|
|
|
|
bool is_action_pressed(const StringName &p_action) const;
|
|
|
|
bool is_action_just_pressed(const StringName &p_action) const;
|
|
|
|
bool is_action_just_released(const StringName &p_action) const;
|
|
|
|
float get_action_strength(const StringName &p_action) const;
|
|
|
|
|
|
|
|
float get_joy_axis(int p_device, int p_axis) const;
|
2015-09-24 21:06:15 +00:00
|
|
|
String get_joy_name(int p_idx);
|
2020-03-01 22:14:37 +00:00
|
|
|
Array get_connected_joypads();
|
|
|
|
Vector2 get_joy_vibration_strength(int p_device);
|
|
|
|
float get_joy_vibration_duration(int p_device);
|
|
|
|
uint64_t get_joy_vibration_timestamp(int p_device);
|
2015-12-18 05:12:53 +00:00
|
|
|
void joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid = "");
|
2017-01-08 20:05:51 +00:00
|
|
|
void parse_joypad_mapping(String p_mapping, bool p_update_existing);
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
Vector3 get_gravity() const;
|
|
|
|
Vector3 get_accelerometer() const;
|
|
|
|
Vector3 get_magnetometer() const;
|
|
|
|
Vector3 get_gyroscope() const;
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
Point2 get_mouse_position() const;
|
|
|
|
Point2 get_last_mouse_speed() const;
|
|
|
|
int get_mouse_button_mask() const;
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
void warp_mouse_position(const Vector2 &p_to);
|
|
|
|
Point2i warp_mouse_motion(const Ref<InputEventMouseMotion> &p_motion, const Rect2 &p_rect);
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
void parse_input_event(const Ref<InputEvent> &p_event);
|
2017-03-19 08:20:20 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_gravity(const Vector3 &p_gravity);
|
|
|
|
void set_accelerometer(const Vector3 &p_accel);
|
|
|
|
void set_magnetometer(const Vector3 &p_magnetometer);
|
|
|
|
void set_gyroscope(const Vector3 &p_gyroscope);
|
|
|
|
void set_joy_axis(int p_device, int p_axis, float p_value);
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration = 0);
|
|
|
|
void stop_joy_vibration(int p_device);
|
|
|
|
void vibrate_handheld(int p_duration_ms = 500);
|
2016-06-15 05:25:35 +00:00
|
|
|
|
2017-03-29 15:29:38 +00:00
|
|
|
void set_mouse_position(const Point2 &p_posf);
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2018-11-09 21:32:32 +00:00
|
|
|
void action_press(const StringName &p_action, float p_strength = 1.f);
|
2017-03-05 15:44:50 +00:00
|
|
|
void action_release(const StringName &p_action);
|
2015-09-24 21:06:15 +00:00
|
|
|
|
|
|
|
void iteration(float p_step);
|
|
|
|
|
2018-02-24 02:04:30 +00:00
|
|
|
void set_emulate_touch_from_mouse(bool p_emulate);
|
2020-03-01 22:14:37 +00:00
|
|
|
bool is_emulating_touch_from_mouse() const;
|
2018-02-24 02:04:30 +00:00
|
|
|
void ensure_touch_mouse_raised();
|
|
|
|
|
|
|
|
void set_emulate_mouse_from_touch(bool p_emulate);
|
2020-03-01 22:14:37 +00:00
|
|
|
bool is_emulating_mouse_from_touch() const;
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
CursorShape get_default_cursor_shape() const;
|
|
|
|
void set_default_cursor_shape(CursorShape p_shape);
|
|
|
|
CursorShape get_current_cursor_shape() const;
|
2020-04-28 13:19:37 +00:00
|
|
|
void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape = Input::CURSOR_ARROW, const Vector2 &p_hotspot = Vector2());
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2015-12-18 05:12:53 +00:00
|
|
|
void parse_mapping(String p_mapping);
|
2017-03-26 13:59:13 +00:00
|
|
|
void joy_button(int p_device, int p_button, bool p_pressed);
|
|
|
|
void joy_axis(int p_device, int p_axis, const JoyAxis &p_value);
|
|
|
|
void joy_hat(int p_device, int p_val);
|
2015-09-24 21:06:15 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
void add_joy_mapping(String p_mapping, bool p_update_existing = false);
|
|
|
|
void remove_joy_mapping(String p_guid);
|
2016-01-07 23:40:41 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
String get_joy_button_string(int p_button);
|
|
|
|
String get_joy_axis_string(int p_axis);
|
|
|
|
int get_joy_axis_index_from_string(String p_axis);
|
|
|
|
int get_joy_button_index_from_string(String p_button);
|
2016-09-20 20:12:52 +00:00
|
|
|
|
2017-02-21 16:02:49 +00:00
|
|
|
int get_unused_joy_id();
|
|
|
|
|
2020-03-03 13:36:29 +00:00
|
|
|
bool is_joy_known(int p_device);
|
|
|
|
String get_joy_guid(int p_device) const;
|
2016-01-27 11:18:34 +00:00
|
|
|
void set_fallback_mapping(String p_guid);
|
2019-03-03 22:52:18 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
void accumulate_input_event(const Ref<InputEvent> &p_event);
|
|
|
|
void flush_accumulated_events();
|
|
|
|
void set_use_accumulated_input(bool p_enable);
|
2019-03-03 22:52:18 +00:00
|
|
|
|
2020-03-01 22:14:37 +00:00
|
|
|
void release_pressed_events();
|
|
|
|
|
2020-03-04 16:36:09 +00:00
|
|
|
void set_event_dispatch_function(EventDispatchFunc p_function);
|
|
|
|
|
2020-04-28 13:19:37 +00:00
|
|
|
Input();
|
2015-09-24 21:06:15 +00:00
|
|
|
};
|
|
|
|
|
2020-04-28 13:19:37 +00:00
|
|
|
VARIANT_ENUM_CAST(Input::MouseMode);
|
|
|
|
VARIANT_ENUM_CAST(Input::CursorShape);
|
2020-03-01 22:14:37 +00:00
|
|
|
|
|
|
|
#endif // INPUT_H
|