Example #1
0
        private void HandleKey(string Keys, VK VirtualKey, Key Scancode, bool Pressed)
        {
            if (!Base.TheBox && Keys.Length < 2)
            {
                BoxSwitch.HandleKey(Keys, VirtualKey, Pressed);
                return;
            }

            if (!Pressed)
            {
                return;
            }

            var special = new Key[] {
                Key.PageUp, Key.PageDown, Key.Home, Key.End, Key.Insert, Key.Delete,
                Key.Back,
                Key.Left, Key.Right, Key.Up, Key.Down,
                Key.F1, Key.F2, Key.F3, Key.F4, Key.F5, Key.F6, Key.F7, Key.F8, Key.F9, Key.F10, Key.F11, Key.F12,
                Key.Escape
            };

            if (special.Contains(Scancode))
            {
                CurrentReceiver.SpecialKey(VirtualKey);
                return;
            }

            foreach (var key in Keys)
            {
                CurrentReceiver.PushKey(key);
            }
        }
Example #2
0
        private void HandleKey(string Keys, VK VirtualKey, int Scancode, bool Pressed)
        {
            if (!Base.TheBox && Keys.Length < 2)
            {
                BoxSwitch.HandleKey(Keys, VirtualKey, Pressed);
                return;
            }

            if (!Pressed)
            {
                return;
            }

            if (special.Contains(VirtualKey))
            {
                CurrentReceiver.SpecialKey(VirtualKey);
                return;
            }

            foreach (var key in Keys)
            {
                CurrentReceiver.PushKey(key);
            }
        }