Esempio n. 1
0
        public void Test_New()
        {
            var alias = new KeyAlias ("Name", KeyCode.Space);

            Assert.AreEqual ("Name", alias.Name);
            Assert.AreEqual (KeyCode.Space, alias.KeyCode);
        }
        public static void Save(string path, KeyAlias key)
        {
            var listing = Load(path);

            if (listing.Contains(key.Alias, key.Id))
            {
                return;
            }

            using (var stream = File.Open(path, FileMode.Create, FileAccess.Write, FileShare.Read))
                new AliasFile(stream).Add(listing, key);
        }
            public void Uses_key_attribute_to_determine_key(IDialect dialect)
            {
                using (var database = BlankDatabaseFactory.MakeDatabase(dialect))
                {
                    // Arrange
                    var entity = new KeyAlias {
                        Name = "Some Name"
                    };

                    // Act
                    database.Insert(entity);

                    // Assert
                    database.Count <KeyAlias>().Should().Be(1);
                }
            }
 private void Add(AliasListing listing, KeyAlias key)
 {
     listing[key.Alias] = key.Id;
     Save(listing);
 }
Esempio n. 5
0
        /// <summary>
        ///     Class Constructor, sets up the required keybinds - TODO: This is where we should pass any user-defined keybinds. Also need a method for updating these later before executing commands probably
        /// </summary>
        public F16C50()
        {
            // INPUT KeyAlias
            KeyAlias.Add("1", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD1
            });
            KeyAlias.Add("2", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD2
            });
            KeyAlias.Add("3", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD3
            });
            KeyAlias.Add("4", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD4
            });
            KeyAlias.Add("5", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD5
            });
            KeyAlias.Add("6", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD6
            });
            KeyAlias.Add("7", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD7
            });
            KeyAlias.Add("8", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD8
            });
            KeyAlias.Add("9", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD9
            });
            KeyAlias.Add("0", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD0
            });

            KeyAlias.Add("RET", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.LEFT
            });
            KeyAlias.Add("ENT", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.NUMPAD_RETURN
            });

            KeyAlias.Add("DCS_DOWN", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.DOWN
            });
            KeyAlias.Add("DCS_UP", new KeyAliasClass()
            {
                modifier = VirtualKeyCode.LCONTROL, action = VirtualKeyCode.UP
            });
        }