Skip to content

Vibrate without calling Sleep #5

@simplifirepyroneil

Description

@simplifirepyroneil

Great work, thank you for this project.

If I want to make the controller vibrate, I use something like this

if(Gamepad.IsConnected)
{
if(!Gamepad.IsVibrationEnabled)
Gamepad.IsVibrationEnabled = true;

        if(Gamepad.Device.SetMotorsSpeed(leftMotor, rightMotor) == false)
        {
           log.Error("Failed to set vibration motors speed on gamepad.");
        }
        Sleep(vibrateTime);
     }

Vibration wont happen unless the sleep is there. I assume that the sleep allows the update timer to get some cycles in. Is there a clean way to allow for the update to happen? I want to have a way to vibrate the controller without sleeping the UI thread.

Neil

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is neededquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions