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

[core] Add Gamepad Vibration functionality #1511

Closed
ghost opened this issue Jan 4, 2021 · 5 comments
Closed

[core] Add Gamepad Vibration functionality #1511

ghost opened this issue Jan 4, 2021 · 5 comments
Labels
external This issue depends on external lib new feature This is an addition to the library

Comments

@ghost
Copy link

ghost commented Jan 4, 2021

Issue description

I wish there was some functionality to vibrate the gamepad with raylib for some enhanced haptics experience. Xbox and PS gamepads support this out of the box for desktop & consoles, HTML5's Gamepad API still doesn't have any functionality for this, but in that platform the method would just not do anything.

I propose there would be 2 methods:

Code Example

bool IsGamepadVibrationSupported(int gamepad);   // checks whether target gamepad device supports vibration
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor);  // sets the vibration strength for the gamepad motors, 0 to 1
@raysan5
Copy link
Owner

raysan5 commented Jan 6, 2021

This features depends on GLFW, at least for PLATFORM_DESKTOP. Related to glfw/glfw#57

@raysan5 raysan5 added the new feature This is an addition to the library label Jan 12, 2021
@raysan5
Copy link
Owner

raysan5 commented Jan 21, 2021

@raysan5 raysan5 added the external This issue depends on external lib label Mar 19, 2021
@OkiStuff
Copy link

has anyone added Gamepad Vibration for web yet?

@raysan5
Copy link
Owner

raysan5 commented Mar 24, 2021

@OkiStuff I'm afraid not.

@raysan5
Copy link
Owner

raysan5 commented Apr 2, 2021

As this issue depends on an external library, I'm closing it. Feel free to open the issue on the specific repo that should implement it or just send a PR for review.

@raysan5 raysan5 closed this as completed Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external This issue depends on external lib new feature This is an addition to the library
Projects
None yet
Development

No branches or pull requests

2 participants