Merge c21aa86a7b into 069f630776
This commit is contained in:
@@ -86,6 +86,11 @@ namespace Ryujinx.Input.SDL2
|
|||||||
Features = GetFeaturesFlag();
|
Features = GetFeaturesFlag();
|
||||||
_triggerThreshold = 0.0f;
|
_triggerThreshold = 0.0f;
|
||||||
|
|
||||||
|
if (SDL_GameControllerHasLED(_gamepadHandle) == SDL_bool.SDL_TRUE)
|
||||||
|
{
|
||||||
|
SetLedColor("FFE3B5");
|
||||||
|
}
|
||||||
|
|
||||||
// Enable motion tracking
|
// Enable motion tracking
|
||||||
if (Features.HasFlag(GamepadFeaturesFlag.Motion))
|
if (Features.HasFlag(GamepadFeaturesFlag.Motion))
|
||||||
{
|
{
|
||||||
@@ -101,6 +106,16 @@ namespace Ryujinx.Input.SDL2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetLedColor(string hex)
|
||||||
|
{
|
||||||
|
ulong LEDcolor = Convert.ToUInt64(hex, 16);
|
||||||
|
byte red = (byte)((LEDcolor >> 16) % 256);
|
||||||
|
byte green = (byte)((LEDcolor >> 8) % 256);
|
||||||
|
byte blue = (byte)(LEDcolor % 256);
|
||||||
|
|
||||||
|
SDL_GameControllerSetLED(_gamepadHandle, red, green, blue);
|
||||||
|
}
|
||||||
|
|
||||||
private GamepadFeaturesFlag GetFeaturesFlag()
|
private GamepadFeaturesFlag GetFeaturesFlag()
|
||||||
{
|
{
|
||||||
GamepadFeaturesFlag result = GamepadFeaturesFlag.None;
|
GamepadFeaturesFlag result = GamepadFeaturesFlag.None;
|
||||||
|
|||||||
Reference in New Issue
Block a user