diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-21 21:10:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 21:10:22 +0200 |
commit | 1a4dbd9ee2fd471108dc4d217aacab74cf412925 (patch) | |
tree | 2563d9aa95cd5b9d5a1a15c76664df2e5d333be5 /platform/iphone/os_iphone.cpp | |
parent | e132c36261e832b7b461d97909bf15786acc85ba (diff) | |
parent | 4061e5bb75cf4ad338cd077713946711cd7c70ea (diff) |
Merge pull request #31437 from volzhs/vibrate-mobile
Support vibration for Android and iOS
Diffstat (limited to 'platform/iphone/os_iphone.cpp')
-rw-r--r-- | platform/iphone/os_iphone.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 825342f911..353078c51c 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -470,6 +470,7 @@ extern void _show_keyboard(String p_existing); extern void _hide_keyboard(); extern Error _shell_open(String p_uri); extern void _set_keep_screen_on(bool p_enabled); +extern void _vibrate(); void OSIPhone::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) { _show_keyboard(p_existing_text); @@ -585,6 +586,11 @@ void OSIPhone::native_video_stop() { _stop_video(); } +void OSIPhone::vibrate_handheld(int p_duration_ms) { + // iOS does not support duration for vibration + _vibrate(); +} + bool OSIPhone::_check_internal_feature_support(const String &p_feature) { return p_feature == "mobile"; |