You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.7 KiB

using System;
using System.Windows.Forms;
namespace NumpadMonitor
{
public class KeySet
{
internal readonly static KeyInfo[] Numpad = new KeyInfo[] {
new KeyInfo(Keys.NumPad0),
new KeyInfo(Keys.NumPad1),
new KeyInfo(Keys.NumPad2),
new KeyInfo(Keys.NumPad3),
new KeyInfo(Keys.NumPad4),
new KeyInfo(Keys.NumPad5),
new KeyInfo(Keys.NumPad6),
new KeyInfo(Keys.NumPad7),
new KeyInfo(Keys.NumPad8),
new KeyInfo(Keys.NumPad9),
new KeyInfo(Keys.Divide),
new KeyInfo(Keys.Multiply),
new KeyInfo(Keys.Subtract),
new KeyInfo(Keys.Add),
new KeyInfo(Keys.Enter),
new KeyInfo(Keys.Decimal),
new KeyInfo(Keys.Delete),
new KeyInfo(Keys.End)
};
internal readonly static KeyInfo[] Alternative = new KeyInfo[] {
new KeyInfo(Keys.F13, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F14, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F15, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F16, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F17, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F18, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F19, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F20, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F21, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F22, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F23, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F24, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Shift})),
new KeyInfo(Keys.F13, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Ctrl})),
new KeyInfo(Keys.F14, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Ctrl})),
new KeyInfo(Keys.F15, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Ctrl})),
new KeyInfo(Keys.F16, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Ctrl})),
new KeyInfo(Keys.F17, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Ctrl})),
new KeyInfo(Keys.F18, KeyInfo.GetModifierInt(new Modifier[]{Modifier.Ctrl}))
};
public static KeyInfo AlternativeToNumpad(KeyInfo key)
{
int index = Array.FindIndex(Alternative, x => x.Equals(key));
return Numpad[index];
}
}
}