public void TurnOff() { if (this.pDevice != IntPtr.Zero) { SteamControllerLib.TurnOff(this.pDevice); } }
public Event ReadEvent() { if (this.pDevice == IntPtr.Zero) { return(null); } SteamControllerLib.Event libEvent; if (!SteamControllerLib.ReadEvent(this.pDevice, out libEvent)) { return(null); } switch ((Event.EventTypeEnum)libEvent.eventType) { case Event.EventTypeEnum.Update: return(new UpdateEvent(ref libEvent)); case Event.EventTypeEnum.Connection: return(new ConnectionEvent(ref libEvent)); case Event.EventTypeEnum.Battery: return(new BatteryEvent(ref libEvent)); } return(null); }
public void CommitPairing(bool connect) { if (this.pDevice != IntPtr.Zero) { SteamControllerLib.CommitPairing(this.pDevice, connect); } }
public void EnablePairing(bool enable) { if (this.pDevice != IntPtr.Zero) { SteamControllerLib.EnablePairing(this.pDevice, enable, 0); } }
public void PlayMelody(uint id) { if (this.pDevice == IntPtr.Zero) { return; } SteamControllerLib.PlayMelody(this.pDevice, id); }
public void TriggerHaptic(ushort motor, ushort onTime, ushort offTime, ushort count) { if (this.pDevice == IntPtr.Zero) { return; } SteamControllerLib.TriggerHaptic(this.pDevice, motor, onTime, offTime, count); }
public static SteamControllerDevice[] OpenControllers() { List <SteamControllerDevice> controllers = new List <SteamControllerDevice> (); IntPtr pEnum = SteamControllerLib.EnumControllerDevices(); while (pEnum != IntPtr.Zero) { IntPtr pDevice = SteamControllerLib.Open(pEnum); if (pDevice != IntPtr.Zero) { controllers.Add(new SteamControllerDevice(pDevice)); } pEnum = SteamControllerLib.NextControllerDevice(pEnum); } return(controllers.ToArray()); }
public void Close() { SteamControllerLib.Close(this.pDevice); this.pDevice = IntPtr.Zero; }