Any example on how to use TriggerSimpleHapticEvent function?
SteamInputTest.cs Line 270: //SteamInput.TriggerSimpleHapticEvent() // TODO Thanks in advance.
Yeah i have no idea how to use that as well
Hi,
add a function to the "Controller.cs" and test/uncomment the method that works with your controller.
public async Task TriggerVibration() { //SteamInput.Internal.Legacy_TriggerHapticPulse( Handle, SteamControllerPad.Right, ushort.MaxValue ); //SteamInput.Internal.Legacy_TriggerRepeatedHapticPulse( Handle, SteamControllerPad.Left, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, uint.MaxValue ); //SteamInput.Internal.TriggerSimpleHapticEvent( Handle, ControllerHapticLocation.Both, byte.MaxValue, char.MaxValue, byte.MaxValue, char.MaxValue ); //SteamInput.Internal.Legacy_TriggerHapticPulse( Handle, SteamControllerPad.Left, ushort.MaxValue ); //SteamInput.Internal.TriggerVibration( Handle, ushort.MinValue, ushort.MinValue ); //SteamInput.Internal.TriggerVibration( Handle, ushort.MaxValue / 500, ushort.MaxValue / 500 ); //SteamInput.Internal.TriggerSimpleHapticEvent( Handle, ControllerHapticLocation.Both, byte.MaxValue, char.MaxValue, byte.MaxValue, char.MaxValue ); SteamInput.Internal.TriggerSimpleHapticEvent( Handle, ControllerHapticLocation.Both, byte.MaxValue, char.MaxValue, byte.MaxValue, char.MaxValue ); //SteamInput.Internal.TriggerVibration( Handle, ushort.MaxValue, ushort.MinValue); //SteamInput.Internal.TriggerVibrationExtended( Handle, ushort.MinValue, ushort.MinValue, ushort.MaxValue, ushort.MaxValue); // SteamInput.Internal.Legacy_TriggerHapticPulse( Handle, SteamControllerPad.Right, 50000 ); //SteamInput.Internal.Legacy_TriggerRepeatedHapticPulse( Handle, SteamControllerPad.Left, ushort.MaxValue, ushort.MinValue, ushort.MaxValue, uint.MinValue ); //SteamInput.Internal.Legacy_TriggerRepeatedHapticPulse( Handle, SteamControllerPad.Right, 50000, 50000, 10, 0 ); }
Use:
await Task.Run(() => { yourcontroller.TriggerVibration().Wait(); } );
also check out this link: https://tenebrisstudio.itch.io/your-computer-might-be-at-risk/devlog/452070/steaminput-implementation
Oh sorry,I forgot to mention, that example is with Facepunch.Steamworks and not Steamworks.NET
Shouldnt there be some await inside the triggerVibration Func?
Mine looks like this inside controller.cs
public async Task TriggerVibration( ushort leftSpeed, ushort rightSpeed ) { SteamInput.Internal.TriggerVibration( Handle, leftSpeed, rightSpeed ); }
I'm awaiting the calling thread, so that the game is not blocked waiting for steaminput calls. await Task.Run(() => yourAsyncSIAPIMethod())
Would you mind showing me a basic example you dont need to explain anything just the code you have in the dll and in you unity project. I really appreciate your help seems like no one is using steam input :)
add me on linked in (see my full name in my github profile) I'll share my screen and explain the process...