@@ -79,6 +79,15 @@ class Input : public Object {
7979 CURSOR_MAX
8080 };
8181
82+ class JoypadFeatures {
83+ public:
84+ virtual ~JoypadFeatures () {}
85+
86+ // None at the moment, but later we can add new features like:
87+ // virtual bool has_joy_accelerometer() const { return false; }
88+ // virtual bool set_joy_accelerometer_enabled(bool p_enable) { return false; }
89+ };
90+
8291 static constexpr int32_t JOYPADS_MAX = 16 ;
8392
8493 typedef void (*EventDispatchFunc)(const Ref<InputEvent> &p_event);
@@ -174,6 +183,7 @@ class Input : public Object {
174183 int mapping = -1 ;
175184 int hat_current = 0 ;
176185 Dictionary info;
186+ Input::JoypadFeatures *features = nullptr ;
177187 };
178188
179189 VelocityTrack mouse_velocity_track;
@@ -253,6 +263,7 @@ class Input : public Object {
253263 void _button_event (int p_device, JoyButton p_index, bool p_pressed);
254264 void _axis_event (int p_device, JoyAxis p_axis, float p_value);
255265 void _update_action_cache (const StringName &p_action_name, ActionState &r_action_state);
266+ void _update_joypad_features (int p_device);
256267
257268 void _parse_input_event_impl (const Ref<InputEvent> &p_event, bool p_is_emulated);
258269
@@ -346,6 +357,8 @@ class Input : public Object {
346357 void set_gyroscope (const Vector3 &p_gyroscope);
347358 void set_joy_axis (int p_device, JoyAxis p_axis, float p_value);
348359
360+ void set_joy_features (int p_device, JoypadFeatures *p_features);
361+
349362 void start_joy_vibration (int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration = 0 );
350363 void stop_joy_vibration (int p_device);
351364 void vibrate_handheld (int p_duration_ms = 500 , float p_amplitude = -1.0 );
0 commit comments