Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamepad haptic feedback support [proposal] #547

Open
cyberarm opened this issue Sep 28, 2020 · 0 comments
Open

Gamepad haptic feedback support [proposal] #547

cyberarm opened this issue Sep 28, 2020 · 0 comments

Comments

@cyberarm
Copy link
Collaborator

Add methods to Gosu
Gosu.gamepad_[haptic|rumble]?(id) - [boolean] whether gamepad supports haptic feedback
Gosu.gamepad_[pulse|rumble](id, duration, strength) - [void] vibrate given gamepad
Gosu.gamepad_[pulse|rumble]_stop(id) - [void] halt all force feedback for gamepad

if Gosu.gamepad_haptic?(0) # gamepad_id
  Gosu.gamepad_pulse(0, 150, 0.75) # gamepad_id, duration in ms, strength as value between 0.0 and 1.0
end

SDL Wiki on Force Feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant