Skip to content

Instantly share code, notes, and snippets.

@Sharparam

Sharparam/KeyMap.cs Secret

Created Oct 28, 2015
Embed
What would you like to do?
namespace Sharparam.WhackAMoleChroma
{
using System.Collections;
using System.Windows.Input;
using ChromaKey = Corale.Colore.Razer.Keyboard.Key;
public static class KeyMap
{
private static readonly Hashtable Mapping = new Hashtable()
{
{ Key.A, ChromaKey.A },
//{ Key.AbntC1, ChromaKey. },
//{ Key.AbntC2, ChromaKey. },
{ Key.Add, ChromaKey.NumAdd },
//{ Key.Apps, ChromaKey. },
//{ Key.Attn, ChromaKey. },
{ Key.B, ChromaKey.B },
{ Key.Back, ChromaKey.Backspace },
//{ Key.BrowserBack, ChromaKey. },
//{ Key.BrowserFavorites, ChromaKey. },
//{ Key.BrowserForward, ChromaKey. },
//{ Key.BrowserHome, ChromaKey. },
//{ Key.BrowserRefresh, ChromaKey. },
//{ Key.BrowserSearch, ChromaKey. },
//{ Key.BrowserStop, ChromaKey. },
{ Key.C, ChromaKey.C },
//{ Key.Cancel, ChromaKey. },
{ Key.CapsLock, ChromaKey.CapsLock },
//{ Key.Clear, ChromaKey. },
//{ Key.CrSel, ChromaKey. },
{ Key.D, ChromaKey.D },
{ Key.D0, ChromaKey.Zero },
{ Key.D1, ChromaKey.One },
{ Key.D2, ChromaKey.Two },
{ Key.D3, ChromaKey.Three },
{ Key.D4, ChromaKey.Four },
{ Key.D5, ChromaKey.Five },
{ Key.D6, ChromaKey.Six },
{ Key.D7, ChromaKey.Seven },
{ Key.D8, ChromaKey.Eight },
{ Key.D9, ChromaKey.Nine },
//{ Key.DbeAlphanumeric, ChromaKey. },
//{ Key.DbeCodeInput, ChromaKey. },
//{ Key.DbeDbcsChar, ChromaKey. },
//{ Key.DbeDetermineString, ChromaKey. },
//{ Key.DbeEnterDialogConversionMode, ChromaKey. },
//{ Key.DbeEnterImeConfigureMode, ChromaKey. },
//{ Key.DbeEnterWordRegisterMode, ChromaKey. },
//{ Key.DbeFlushString, ChromaKey. },
//{ Key.DbeHiragana, ChromaKey. },
//{ Key.DbeKatakana, ChromaKey. },
//{ Key.DbeNoCodeInput, ChromaKey. },
//{ Key.DbeNoRoman, ChromaKey. },
//{ Key.DbeRoman, ChromaKey. },
//{ Key.DbeSbcsChar, ChromaKey. },
//{ Key.DeadCharProcessed, ChromaKey. },
{ Key.Decimal, ChromaKey.NumDecimal },
{ Key.Delete, ChromaKey.Delete },
{ Key.Divide, ChromaKey.NumDivide },
{ Key.Down, ChromaKey.Down },
{ Key.E, ChromaKey.E },
{ Key.End, ChromaKey.End },
{ Key.Enter, ChromaKey.Enter },
//{ Key.EraseEof, ChromaKey. },
{ Key.Escape, ChromaKey.Escape },
//{ Key.Execute, ChromaKey. },
//{ Key.ExSel, ChromaKey. },
{ Key.F, ChromaKey.F },
{ Key.F1, ChromaKey.F1 },
{ Key.F10, ChromaKey.F10 },
{ Key.F11, ChromaKey.F11 },
{ Key.F12, ChromaKey.F12 },
//{ Key.F13, ChromaKey. },
//{ Key.F14, ChromaKey. },
//{ Key.F15, ChromaKey. },
//{ Key.F16, ChromaKey. },
//{ Key.F17, ChromaKey. },
//{ Key.F18, ChromaKey. },
//{ Key.F19, ChromaKey. },
{ Key.F2, ChromaKey.F2 },
//{ Key.F20, ChromaKey. },
//{ Key.F21, ChromaKey. },
//{ Key.F22, ChromaKey. },
//{ Key.F23, ChromaKey. },
//{ Key.F24, ChromaKey. },
{ Key.F3, ChromaKey.F3 },
{ Key.F4, ChromaKey.F4 },
{ Key.F5, ChromaKey.F5 },
{ Key.F6, ChromaKey.F6 },
{ Key.F7, ChromaKey.F7 },
{ Key.F8, ChromaKey.F8 },
{ Key.F9, ChromaKey.F9 },
//{ Key.FinalMode, ChromaKey. },
{ Key.G, ChromaKey.G },
{ Key.H, ChromaKey.H },
//{ Key.HangulMode, ChromaKey. },
//{ Key.HanjaMode, ChromaKey. },
//{ Key.Help, ChromaKey. },
{ Key.Home, ChromaKey.Home },
{ Key.I, ChromaKey.I },
//{ Key.ImeAccept, ChromaKey. },
//{ Key.ImeConvert, ChromaKey. },
//{ Key.ImeModeChange, ChromaKey. },
//{ Key.ImeNonConvert, ChromaKey. },
//{ Key.ImeProcessed, ChromaKey. },
{ Key.Insert, ChromaKey.Insert },
{ Key.J, ChromaKey.J },
//{ Key.JunjaMode, ChromaKey. },
{ Key.K, ChromaKey.K },
//{ Key.KanaMode, ChromaKey. },
//{ Key.KanjiMode, ChromaKey. },
{ Key.L, ChromaKey.L },
//{ Key.LaunchApplication1, ChromaKey. },
//{ Key.LaunchApplication2, ChromaKey. },
//{ Key.LaunchMail, ChromaKey. },
{ Key.Left, ChromaKey.Left },
{ Key.LeftAlt, ChromaKey.LeftAlt },
{ Key.LeftCtrl, ChromaKey.LeftControl },
{ Key.LeftShift, ChromaKey.LeftShift },
//{ Key.LineFeed, ChromaKey. },
{ Key.LWin, ChromaKey.LeftWindows },
{ Key.M, ChromaKey.M },
//{ Key.MediaNextTrack, ChromaKey. },
//{ Key.MediaPlayPause, ChromaKey. },
//{ Key.MediaPreviousTrack, ChromaKey. },
//{ Key.MediaStop, ChromaKey. },
{ Key.Multiply, ChromaKey.NumMultiply },
{ Key.N, ChromaKey.N },
//{ Key.Next, ChromaKey. },
//{ Key.NoName, ChromaKey. },
{ Key.None, ChromaKey.Invalid },
{ Key.NumLock, ChromaKey.NumLock },
{ Key.NumPad0, ChromaKey.Num0 },
{ Key.NumPad1, ChromaKey.Num1 },
{ Key.NumPad2, ChromaKey.Num2 },
{ Key.NumPad3, ChromaKey.Num3 },
{ Key.NumPad4, ChromaKey.Num4 },
{ Key.NumPad5, ChromaKey.Num5 },
{ Key.NumPad6, ChromaKey.Num6 },
{ Key.NumPad7, ChromaKey.Num7 },
{ Key.NumPad8, ChromaKey.Num8 },
{ Key.NumPad9, ChromaKey.Num9 },
{ Key.O, ChromaKey.O },
//{ Key.Oem102, ChromaKey. },
{ Key.Oem2, ChromaKey.Oem2 },
{ Key.Oem5, ChromaKey.Oem5 },
{ Key.Oem7, ChromaKey.Oem7 },
{ Key.Oem8, ChromaKey.Oem8 },
//{ Key.OemAttn, ChromaKey. },
//{ Key.OemAuto, ChromaKey. },
{ Key.OemBackslash, ChromaKey.Oem11 },
//{ Key.OemBackTab, ChromaKey. },
//{ Key.OemClear, ChromaKey. },
{ Key.OemCloseBrackets, ChromaKey.Oem5 },
{ Key.OemComma, ChromaKey.Oem9 },
//{ Key.OemCopy, ChromaKey. },
//{ Key.OemEnlw, ChromaKey. },
//{ Key.OemFinish, ChromaKey. },
{ Key.OemMinus, ChromaKey.Oem2 },
{ Key.OemOpenBrackets, ChromaKey.Oem4 },
{ Key.OemPeriod, ChromaKey.Oem10 },
//{ Key.OemPipe, ChromaKey. },
//{ Key.OemPlus, ChromaKey. },
//{ Key.OemQuestion, ChromaKey. },
//{ Key.OemQuotes, ChromaKey. },
{ Key.OemSemicolon, ChromaKey.Oem7 },
{ Key.OemTilde, ChromaKey.Oem1 },
{ Key.P, ChromaKey.P },
//{ Key.Pa1, ChromaKey. },
{ Key.PageDown, ChromaKey.PageDown },
{ Key.PageUp, ChromaKey.PageUp },
{ Key.Pause, ChromaKey.Pause },
//{ Key.Play, ChromaKey. },
{ Key.Print, ChromaKey.PrintScreen },
{ Key.PrintScreen, ChromaKey.PrintScreen },
{ Key.Q, ChromaKey.Q },
{ Key.R, ChromaKey.R },
{ Key.Right, ChromaKey.Right },
{ Key.RightAlt, ChromaKey.RightAlt },
{ Key.RightCtrl, ChromaKey.RightControl },
{ Key.RightShift, ChromaKey.RightShift },
//{ Key.RWin, ChromaKey. },
{ Key.S, ChromaKey.S },
{ Key.Scroll, ChromaKey.Scroll },
//{ Key.Select, ChromaKey. },
//{ Key.SelectMedia, ChromaKey. },
//{ Key.Separator, ChromaKey. },
//{ Key.Sleep, ChromaKey. },
//{ Key.Snapshot, ChromaKey. },
{ Key.Space, ChromaKey.Space },
{ Key.Subtract, ChromaKey.NumSubtract },
//{ Key.System, ChromaKey. },
{ Key.T, ChromaKey.T },
{ Key.Tab, ChromaKey.Tab },
{ Key.U, ChromaKey.U },
{ Key.Up, ChromaKey.Up },
{ Key.V, ChromaKey.V },
//{ Key.VolumeDown, ChromaKey. },
//{ Key.VolumeMute, ChromaKey. },
//{ Key.VolumeUp, ChromaKey. },
{ Key.W, ChromaKey.W },
{ Key.X, ChromaKey.X },
{ Key.Y, ChromaKey.Y },
{ Key.Z, ChromaKey.Z },
//{ Key.Zoom, ChromaKey. }
};
public static bool Contains(Key key)
{
return Mapping.ContainsKey(key);
}
public static ChromaKey Get(Key key)
{
return (ChromaKey)Mapping[key];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.