コード例 #1
0
ファイル: HidCodes.cs プロジェクト: nbclark/mobile-remote
 public static int GetHidCode(HidKeys key)
 {
     if (hidCodes.ContainsKey(key))
     {
         return(hidCodes[key]);
     }
     throw new InvalidOperationException("Key not found");
 }
コード例 #2
0
ファイル: HidCodes.cs プロジェクト: nbclark/mobile-remote
 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);
 }
コード例 #3
0
ファイル: HidCodes.cs プロジェクト: nbclark/mobile-remote
 public static int GetHidCode(HidKeys key)
 {
     if (hidCodes.ContainsKey(key))
     {
         return hidCodes[key];
     }
     throw new InvalidOperationException("Key not found");
 }
コード例 #4
0
ファイル: HidCodes.cs プロジェクト: nbclark/mobile-remote
 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;
 }
コード例 #5
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();
            }
コード例 #6
0
 public KeyButton(KeyButtonType type, string key, string shiftKey, HidKeys hidKey, short keyWidth)
 {
     Type = type;
     Key = key;
     ShiftKey = shiftKey;
     KeyWidth = keyWidth;
     HidKey = hidKey;
 }
コード例 #7
0
 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]);
 }
コード例 #8
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();
            }