From 44e5751d7555fca2300fa6eb150b12a89a71ce53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Mon, 28 Nov 2022 20:29:45 +0100 Subject: [PATCH] The `X360.Beep()` is implemented as a separate device --- SteamController/Devices/Xbox360Controller.cs | 22 ++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/SteamController/Devices/Xbox360Controller.cs b/SteamController/Devices/Xbox360Controller.cs index 9b778d4..e099ce8 100644 --- a/SteamController/Devices/Xbox360Controller.cs +++ b/SteamController/Devices/Xbox360Controller.cs @@ -93,19 +93,15 @@ namespace SteamController.Devices internal void Beep() { - // TODO: reconnect to beep - if (isConnected) - { - device?.Disconnect(); - Thread.Sleep(100); - device?.Connect(); - } - else - { - device?.Connect(); - Thread.Sleep(100); - device?.Disconnect(); - } + var client = this.client; + if (client is null) + return; + + // Generate dummy xbox360 controller to generate notification + var device = client.CreateXbox360Controller(); + device.Connect(); + Thread.Sleep(100); + device.Disconnect(); } internal void Update()