-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expose a GamepadProvider and use Responder types for messages #41453
Copy link
Copy link
Closed
Description
We should create a GamepadProvider like the ClipboardProvider that we have. This would be responsible for managing all interactions with gamepads. In addition, a default implementation would be provided that did nothing.
The API for this would look like this:
trait GamepadProvider {
/// Request to play a haptic effect on a connected gamepad.
fn play_haptic_effect(
&self,
_webview: WebView,
_gamepad_index: usize,
_effect_type: GamepadHapticEffectType,
_responder: IpcResponder<bool>
);
/// Request to stop a haptic effect on a connected gamepad.
fn stop_haptic_effect(&self, _webview: WebView, gamepad_index: usize, _responder: IpcResponder<bool>) {}
}Each resonder would be default send a false (for failure message). The default implementation of this trait would just always return failures (the implementation of the methods would be empty).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels