Compare commits

...

18 Commits

Author SHA1 Message Date
Otozinclus
222875d5cc Merge 5276991517 into c140e9b23c 2025-01-23 08:18:49 +01:00
Evan Husted
5276991517 Update SDL2Gamepad.cs 2025-01-22 22:37:03 -06:00
Evan Husted
898153ae13 Update SDL2Gamepad.cs 2025-01-22 22:35:09 -06:00
mika
96e9e3611d move logic around 2025-01-23 05:29:18 +01:00
mika
9aa834c268 maybe this works 2025-01-23 05:02:11 +01:00
mika
97dfeae99f test2 2025-01-23 04:24:01 +01:00
mika
740e35872d test 2025-01-23 03:40:45 +01:00
mika
2c4236f733 test 2025-01-23 03:39:33 +01:00
mika
e945565259 just testing if git works 2025-01-23 03:38:00 +01:00
mika
bdaaddb591 just testing if git is working 2025-01-23 03:38:00 +01:00
Otozinclus
488b09f974 Check if controller has a controllable LED 2025-01-23 03:38:00 +01:00
Evan Husted
f4c3a2e487 fix formatting & styling 2025-01-23 03:37:59 +01:00
Otozinclus
eff11f52a8 Change controller LED color
This changes the controller LED color. Now I need to add the option to change it in the settings
2025-01-23 03:37:59 +01:00
mika
c21aa86a7b just testing if git works 2025-01-23 00:09:07 +01:00
mika
861531f431 just testing if git is working 2025-01-23 00:06:24 +01:00
Otozinclus
6c0526c59f Check if controller has a controllable LED 2025-01-22 23:18:41 +01:00
Evan Husted
e861204078 fix formatting & styling 2025-01-22 16:04:57 -06:00
Otozinclus
8904397685 Change controller LED color
This changes the controller LED color. Now I need to add the option to change it in the settings
2025-01-22 21:55:53 +01:00

View File

@@ -1,6 +1,7 @@
using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Configuration.Hid.Controller;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Hid;
using SDL2;
using System;
using System.Collections.Generic;
@@ -86,7 +87,7 @@ namespace Ryujinx.Input.SDL2
Id = driverId;
Features = GetFeaturesFlag();
_triggerThreshold = 0.0f;
// Enable motion tracking
if (Features.HasFlag(GamepadFeaturesFlag.Motion))
{
@@ -102,6 +103,19 @@ namespace Ryujinx.Input.SDL2
}
}
public void SetLedColor()
{
if (!HasConfiguration) return;
if (!_configuration.Led.EnableLed) return;
uint _rawColor = _configuration.Led.LedColor;
byte red = (byte)(_rawColor >> 16);
byte green = (byte)(_rawColor >> 8);
byte blue = (byte)(_rawColor % 256);
SDL_GameControllerSetLED(_gamepadHandle, red, green, blue);
}
private GamepadFeaturesFlag GetFeaturesFlag()
{
GamepadFeaturesFlag result = GamepadFeaturesFlag.None;
@@ -220,6 +234,9 @@ namespace Ryujinx.Input.SDL2
{
_configuration = (StandardControllerInputConfig)configuration;
if (Features.HasFlag(GamepadFeaturesFlag.Led))
SetLedColor();
_buttonsUserMapping.Clear();
// First update sticks