Log keyboard UI events only on key state changes

This commit is contained in:
Babib3l
2026-04-08 18:19:19 +02:00
parent 8d5adfed14
commit 031cd90048

View File

@@ -209,6 +209,8 @@ namespace Ryujinx.Ava.Input
ConfigPhysicalKey physicalKey = GetPhysicalInputKey(args, semanticKey, out PhysicalKeySource physicalKeySource); ConfigPhysicalKey physicalKey = GetPhysicalInputKey(args, semanticKey, out PhysicalKeySource physicalKeySource);
bool semanticWasPressed = _semanticPressedKeys.Contains(resolvedSemanticKey); bool semanticWasPressed = _semanticPressedKeys.Contains(resolvedSemanticKey);
bool physicalWasPressed = _physicalPressedKeys.Contains(physicalKey); bool physicalWasPressed = _physicalPressedKeys.Contains(physicalKey);
bool semanticStateChanged = resolvedSemanticKey is not Key.Unknown and not Key.Unbound && semanticWasPressed != isPressed;
bool physicalStateChanged = physicalKey is not ConfigPhysicalKey.Unknown and not ConfigPhysicalKey.Unbound && physicalWasPressed != isPressed;
bool bufferedSemanticPress = false; bool bufferedSemanticPress = false;
bool bufferedPhysicalPress = false; bool bufferedPhysicalPress = false;
@@ -240,7 +242,8 @@ namespace Ryujinx.Ava.Input
_observedPhysicalKeysBySemanticKey[semanticKey] = physicalKey; _observedPhysicalKeysBySemanticKey[semanticKey] = physicalKey;
} }
if (ConfigurationState.Instance.Logger.EnableAvaloniaLog) if (ConfigurationState.Instance.Logger.EnableAvaloniaLog &&
(semanticStateChanged || physicalStateChanged))
{ {
Logger.Info?.Print( Logger.Info?.Print(
LogClass.UI, LogClass.UI,