public static int GetHidCode(HidKeys key) { if (hidCodes.ContainsKey(key)) { return(hidCodes[key]); } throw new InvalidOperationException("Key not found"); }
public static char GetHidChar(HidKeys key, bool shiftDown) { foreach (char c in charCodes.Keys) { if (charCodes[c].Key == key && charCodes[c].Value == shiftDown) { return(c); } } return((char)0); }
public static int GetHidCode(HidKeys key) { if (hidCodes.ContainsKey(key)) { return hidCodes[key]; } throw new InvalidOperationException("Key not found"); }
public static char GetHidChar(HidKeys key, bool shiftDown) { foreach (char c in charCodes.Keys) { if (charCodes[c].Key == key && charCodes[c].Value == shiftDown) { return c; } } return (char)0; }
public void ReadXml(System.Xml.XmlReader reader) { //key, shiftkey, keywidth, scancode, type this.Type = (KeyButtonType)Enum.Parse(typeof(KeyButtonType), reader.GetAttribute("Type"), true); this.Key = reader.GetAttribute("Key"); this.ShiftKey = reader.GetAttribute("ShiftKey"); this.KeyWidth = short.Parse(reader.GetAttribute("KeyWidth")); this.IsChar = Convert.ToBoolean(reader.GetAttribute("IsChar")); this.HidKey = (HidKeys)Enum.Parse(typeof(HidKeys), reader.GetAttribute("HidKey"), true); this._iconName = reader.GetAttribute("IconName"); this._iconType = reader.GetAttribute("IconType"); Initialize(); }
public KeyButton(KeyButtonType type, string key, string shiftKey, HidKeys hidKey, short keyWidth) { Type = type; Key = key; ShiftKey = shiftKey; KeyWidth = keyWidth; HidKey = hidKey; }
public KeyButton(string key, string shiftKey, short keyWidth) : this(KeyButtonType.Tap, key, shiftKey, HidKeys.None, keyWidth) { this.IsChar = true; this.HidKey = HidCodes.GetHidKey(key[0]); }
public KeyButton(KeyButtonType type, string key, string shiftKey, HidKeys hidKey, short keyWidth, Type bitmapType, string propertyName) : this(type, key, shiftKey, hidKey, keyWidth) { if (null == bitmapType) { bitmapType = typeof(Properties.Resources); } _iconType = bitmapType.AssemblyQualifiedName; _iconName = propertyName; Initialize(); }