mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-04 22:07:40 +00:00
SteamController: Fix PS button and Gyro support for DS4
Make DS4 fields be readonly and optimise DS4 packets.
This commit is contained in:
parent
eed1453daf
commit
00a30cbf5c
5 changed files with 65 additions and 54 deletions
|
|
@ -1,6 +1,6 @@
|
|||
namespace CommonHelpers
|
||||
{
|
||||
public class TimedValue<T> where T : struct
|
||||
public struct TimedValue<T> where T : struct
|
||||
{
|
||||
public T Value { get; }
|
||||
public DateTime ExpiryDate { get; }
|
||||
|
|
@ -32,9 +32,19 @@ namespace CommonHelpers
|
|||
return Valid;
|
||||
}
|
||||
|
||||
public T? GetValue()
|
||||
{
|
||||
return Valid ? Value : null;
|
||||
}
|
||||
|
||||
public T GetValueOrDefault(T defaultValue)
|
||||
{
|
||||
return Valid ? Value : defaultValue;
|
||||
}
|
||||
|
||||
public static implicit operator T?(TimedValue<T> tv)
|
||||
{
|
||||
return tv.Valid ? tv.Value : null;
|
||||
return tv.GetValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue