Mesen2/UI/Utilities/KeyExtensions.cs
Sour bdbcf4e221 Input: Only apply recent KeyUp processing changes to keys that cause the original issue
Some typical scenarios can cause KeyUp only on regular keys, which can be annoying (e.g pressing Esc to exit a configuration dialog ends up toggling pause)
2024-07-14 20:28:29 +09:00

28 lines
610 B
C#

using Avalonia.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Mesen.Utilities
{
public static class KeyExtensions
{
public static bool IsSpecialKey(this Key key)
{
//Some keys only trigger a KeyUp event without a matching KeyDown event
//And some trigger both events at the same time, causing the emulator to never see the key press.
switch(key) {
case Key.PrintScreen:
case Key.Pause:
case Key.Scroll:
return true;
default:
return false;
}
}
}
}