Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 222875d5cc | |||
| 5276991517 | |||
| 898153ae13 | |||
| 96e9e3611d | |||
| 9aa834c268 | |||
| 97dfeae99f | |||
| 740e35872d | |||
| 2c4236f733 | |||
| e945565259 | |||
| bdaaddb591 | |||
| 488b09f974 | |||
| f4c3a2e487 | |||
| eff11f52a8 | |||
| c21aa86a7b | |||
| 861531f431 | |||
| 6c0526c59f | |||
| e861204078 | |||
| 8904397685 |
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user