mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-05 03:49:17 +00:00
fix for caps lock
This commit is contained in:
@@ -51,6 +51,11 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
|
||||
if (TryNormalizeObservedPrintableLabel(args.KeySymbol, out string label))
|
||||
{
|
||||
if (IsCapsLockOn() && !char.IsLetter(label[0]))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_observedLayoutLabels.TryGetValue(physicalKey, out string existingLabel) && existingLabel == label)
|
||||
{
|
||||
return;
|
||||
@@ -92,6 +97,18 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool IsCapsLockOn()
|
||||
{
|
||||
try
|
||||
{
|
||||
return OperatingSystem.IsWindows() && Console.CapsLock;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TryNormalizeObservedPrintableLabel(string keySymbol, out string label)
|
||||
{
|
||||
if (string.IsNullOrEmpty(keySymbol) || keySymbol.Length != 1 || char.IsControl(keySymbol[0]))
|
||||
|
||||
Reference in New Issue
Block a user