Migrate macos controller API to GameController.h

This should fix a lot of issues regarding to old controller API, such as vibration

Haptics (vibrations) are only available in macOS 11+, so haptics are now
processed in macOS 11+ only. Also, this doesn't interfere with
controller's input as controller support is available in macOS 10.9+.

Added a Note for macOS regarding vibration support
This commit is contained in:
Jezer Mejía
2023-08-16 02:42:12 -06:00
parent b7145638d5
commit 07313a08f4
9 changed files with 664 additions and 696 deletions

View File

@@ -383,6 +383,7 @@
<description>
Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. [param weak_magnitude] is the strength of the weak motor (between 0 and 1) and [param strong_magnitude] is the strength of the strong motor (between 0 and 1). [param duration] is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely). The vibration can be stopped early by calling [method stop_joy_vibration].
[b]Note:[/b] Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds.
[b]Note:[/b] For macOS, vibration is only supported in macOS 11 and later.
</description>
</method>
<method name="stop_joy_vibration">