You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Support adding advanced joypad features
This commit is contained in:
@@ -208,6 +208,8 @@ void JoypadSDL::process_events() {
|
||||
device_name,
|
||||
joypads[joy_id].guid,
|
||||
joypad_info);
|
||||
|
||||
Input::get_singleton()->set_joy_features(joy_id, &joypads[joy_id]);
|
||||
}
|
||||
// An event for an attached joypad
|
||||
} else if (sdl_event.type >= SDL_EVENT_JOYSTICK_AXIS_MOTION && sdl_event.type < SDL_EVENT_FINGER_DOWN && sdl_instance_id_to_joypad_id.has(sdl_event.jdevice.which)) {
|
||||
@@ -299,4 +301,12 @@ void JoypadSDL::close_joypad(int p_pad_idx) {
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Joystick *JoypadSDL::Joypad::get_sdl_joystick() const {
|
||||
return SDL_GetJoystickFromID(sdl_instance_idx);
|
||||
}
|
||||
|
||||
SDL_Gamepad *JoypadSDL::Joypad::get_sdl_gamepad() const {
|
||||
return SDL_GetGamepadFromID(sdl_instance_idx);
|
||||
}
|
||||
|
||||
#endif // SDL_ENABLED
|
||||
|
||||
Reference in New Issue
Block a user