Flush internal driver state before unblocking input updates
This commit is contained in:
parent
4346314e40
commit
f01d31e893
5 changed files with 20 additions and 2 deletions
|
@ -81,6 +81,11 @@ namespace Ryujinx.Input.GTK3
|
|||
return _pressedKeys.Contains(nativeKey);
|
||||
}
|
||||
|
||||
public void Flush()
|
||||
{
|
||||
_pressedKeys.Clear();
|
||||
}
|
||||
|
||||
public IGamepad GetGamepad(string id)
|
||||
{
|
||||
if (!_keyboardIdentifers[0].Equals(id))
|
||||
|
|
|
@ -174,6 +174,11 @@ namespace Ryujinx.Input.HLE
|
|||
{
|
||||
lock (_lock)
|
||||
{
|
||||
foreach (InputConfig inputConfig in _inputConfig)
|
||||
{
|
||||
_controllers[(int)inputConfig.PlayerIndex].GamepadDriver.Flush();
|
||||
}
|
||||
|
||||
_blockInputUpdates = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ryujinx.Input
|
||||
{
|
||||
|
@ -33,5 +34,12 @@ namespace Ryujinx.Input
|
|||
/// <param name="id">The unique id of the gamepad</param>
|
||||
/// <returns>An instance of <see cref="IGamepad"/> associated to the gamepad id given or null if not found</returns>
|
||||
IGamepad GetGamepad(string id);
|
||||
|
||||
/// <summary>
|
||||
/// Flush the internal state of the driver.
|
||||
/// </summary>
|
||||
/// <remarks>Does nothing by default.</remarks>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void Flush() { }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ namespace Ryujinx.Ava.Input
|
|||
|
||||
public void Clear()
|
||||
{
|
||||
_driver?.ResetKeys();
|
||||
_driver?.Flush();
|
||||
}
|
||||
|
||||
public void Dispose() { }
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace Ryujinx.Ava.Input
|
|||
return _pressedKeys.Contains(nativeKey);
|
||||
}
|
||||
|
||||
public void ResetKeys()
|
||||
public void Flush()
|
||||
{
|
||||
_pressedKeys.Clear();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue