feat: upgrade version. implement more keys.

This commit is contained in:
rabbitism
2024-03-10 12:33:26 +08:00
parent dd31df874a
commit 7e7c020b57
4 changed files with 183 additions and 32 deletions

View File

@@ -76,14 +76,30 @@ public class NumPad: TemplatedControl
[Key.NumPad7] = "7",
[Key.NumPad8] = "8",
[Key.NumPad9] = "9",
[Key.OemPlus] = "+",
[Key.OemMinus] = "-",
[Key.Add] = "+",
[Key.Subtract] = "-",
[Key.Multiply] = "*",
[Key.Divide] = "/",
[Key.Decimal] = ".",
};
public void ProcessClick(object o)
{
if (Target?.IsFocused != true)
{
return;
}
if (o is NumPadButton b)
{
if (b.NumKey is null)
{
Target?.RaiseEvent(new KeyEventArgs()
{
Source = this,
RoutedEvent = KeyDownEvent,
Key = b.FunctionKey ?? Key.None,
});
}
if (b is { NumMode: true, NumKey: not null })
{
Target?.RaiseEvent(new TextInputEventArgs()