You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
HTML5: Add support for Input.vibrate_handheld()
This commit is contained in:
@@ -534,6 +534,15 @@ const GodotInput = {
|
||||
GodotRuntime.free(ptr);
|
||||
}, false);
|
||||
},
|
||||
|
||||
godot_js_input_vibrate_handheld__sig: 'vi',
|
||||
godot_js_input_vibrate_handheld: function (p_duration_ms) {
|
||||
if (typeof navigator.vibrate !== 'function') {
|
||||
GodotRuntime.print('This browser does not support vibration.');
|
||||
} else {
|
||||
navigator.vibrate(p_duration_ms);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
autoAddDeps(GodotInput, '$GodotInput');
|
||||
|
||||
Reference in New Issue
Block a user