summaryrefslogtreecommitdiff
path: root/main/input_default.h
diff options
context:
space:
mode:
Diffstat (limited to 'main/input_default.h')
-rw-r--r--main/input_default.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/main/input_default.h b/main/input_default.h
index 8f6a430436..01b813f3ca 100644
--- a/main/input_default.h
+++ b/main/input_default.h
@@ -3,6 +3,7 @@
#include "os/input.h"
+
class InputDefault : public Input {
OBJ_TYPE( InputDefault, Input );
@@ -19,6 +20,16 @@ class InputDefault : public Input {
MainLoop *main_loop;
bool emulate_touch;
+
+ struct VibrationInfo {
+ float weak_magnitude;
+ float strong_magnitude;
+ float duration; // Duration in seconds
+ uint64_t timestamp;
+ };
+
+ Map<int, VibrationInfo> joy_vibration;
+
struct SpeedTrack {
uint64_t last_tick;
@@ -129,6 +140,9 @@ public:
virtual float get_joy_axis(int p_device,int p_axis);
String get_joy_name(int p_idx);
+ virtual Vector2 get_joy_vibration_strength(int p_device);
+ virtual float get_joy_vibration_duration(int p_device);
+ virtual uint64_t get_joy_vibration_timestamp(int p_device);
void joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid = "");
void parse_joystick_mapping(String p_mapping, bool p_update_existing);
@@ -147,6 +161,9 @@ public:
void set_magnetometer(const Vector3& p_magnetometer);
void set_joy_axis(int p_device,int p_axis,float p_value);
+ virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration);
+ virtual void stop_joy_vibration(int p_device);
+
void set_main_loop(MainLoop *main_loop);
void set_mouse_pos(const Point2& p_posf);