mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
iOS: Implement missing gamepad.buttonOptions, buttonMenu, and buttonHome joy buttons
(cherry picked from commit 0a85e4db71)
This commit is contained in:
committed by
Rémi Verschelde
parent
c2e9cc4542
commit
e266ac4e3e
@@ -309,6 +309,23 @@ void JoypadIPhone::start_processing() {
|
||||
float value = gamepad.rightTrigger.value;
|
||||
OSIPhone::get_singleton()->joy_axis(joy_id, JOY_ANALOG_R2, value);
|
||||
}
|
||||
|
||||
if (@available(iOS 13, *)) {
|
||||
if (element == gamepad.buttonOptions) {
|
||||
OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_10,
|
||||
gamepad.buttonOptions.isPressed);
|
||||
} else if (element == gamepad.buttonMenu) {
|
||||
OSIPhone::get_singleton()->joy_button(joy_id, JOY_BUTTON_11,
|
||||
gamepad.buttonMenu.isPressed);
|
||||
}
|
||||
}
|
||||
|
||||
if (@available(iOS 14, *)) {
|
||||
if (element == gamepad.buttonHome) {
|
||||
OSIPhone::get_singleton()->joy_button(joy_id, JOY_GUIDE,
|
||||
gamepad.buttonHome.isPressed);
|
||||
}
|
||||
}
|
||||
};
|
||||
} else if (controller.microGamepad != nil) {
|
||||
// micro gamepads were added in OS 9 and feature just 2 buttons and a d-pad
|
||||
|
||||
Reference in New Issue
Block a user