コード例 #1
0
        private void Recorders_OnKeyChanged(object sender, KeyChangedEventArgs e)
        {
            if (!(sender is KeyBox box))
            {
                return;
            }

            var list = new List <Tuple <Key, ModifierKeys> >
            {
                new Tuple <Key, ModifierKeys>(UserSettings.All.RecorderShortcut, UserSettings.All.RecorderModifiers),
                new Tuple <Key, ModifierKeys>(UserSettings.All.EditorShortcut, UserSettings.All.EditorModifiers),
                new Tuple <Key, ModifierKeys>(UserSettings.All.OptionsShortcut, UserSettings.All.OptionsModifiers),
                new Tuple <Key, ModifierKeys>(UserSettings.All.ExitShortcut, UserSettings.All.ExitModifiers),
                new Tuple <Key, ModifierKeys>(UserSettings.All.StartPauseShortcut, UserSettings.All.StartPauseModifiers),
                new Tuple <Key, ModifierKeys>(UserSettings.All.StopShortcut, UserSettings.All.StopModifiers),
                new Tuple <Key, ModifierKeys>(UserSettings.All.DiscardShortcut, UserSettings.All.DiscardModifiers)
            };

            //If this new shortcut is already in use.
            if (box.MainKey != Key.None && list.Count(c => c.Item1 == box.MainKey && c.Item2 == box.ModifierKeys) > 1)
            {
                box.MainKey      = e.PreviousKey;
                box.ModifierKeys = e.PreviousModifiers;
                e.Cancel         = true;
            }
        }
コード例 #2
0
 private void OnSourceKeyChanged(object sender, KeyChangedEventArgs args)
 {
     if (SourceKeyChanged != null)
     {
         SourceKeyChanged(sender, args);
     }
 }
コード例 #3
0
        protected void RaiseKeyChanged(KeyChangedEventArgs e)
        {
            var ev = KeyChanged;

            if (ev != null)
            {
                ev(this, e);
            }
        }
コード例 #4
0
        /// <summary>
        /// Raises the <see cref="KeyChanged"/> event.
        /// </summary>
        /// <param name="e">
        /// The event arguments.
        /// </param>
        protected void OnKeyChanged(KeyChangedEventArgs e)
        {
            var ev = this.KeyChanged;

            if (ev != null)
            {
                ev(this, e);
            }
        }
コード例 #5
0
 private void DiscardKeyBox_OnKeyChanged(object sender, KeyChangedEventArgs e)
 {
     if (UserSettings.All.DiscardShortcut == UserSettings.All.StartPauseShortcut && UserSettings.All.DiscardModifiers == UserSettings.All.StartPauseModifiers ||
         UserSettings.All.DiscardShortcut == UserSettings.All.StopShortcut && UserSettings.All.DiscardModifiers == UserSettings.All.StopModifiers)
     {
         UserSettings.All.DiscardShortcut  = e.PreviousKey;
         UserSettings.All.DiscardModifiers = e.PreviousModifiers;
         e.Cancel = true;
     }
 }
コード例 #6
0
        public void OnSourceKeyChange(object sender, KeyChangedEventArgs args)
        {
            SourceField sourceField;

            if (sender is SourceField)
            {
                sourceField = sender as SourceField;
                keys[keys.IndexOf(args.OldKey)] = args.NewKey;
                KeysComboBox.Items.Remove(args.OldKey);
                KeysComboBox.Items.Add(args.NewKey);
            }
        }
コード例 #7
0
        /// <inheritdoc/>
        public void HandleKeyEvent(object sender, KeyChangedEventArgs e)
        {
            // The following keys influence the framebuffer:
            // + doubles the size of the framebuffer
            // - custs the size of the framebuffer in half
            // r rotates the framebuffer 90 degrees
            // R sets the framebuffer to a _red_ screen
            // G sets the framebuffer to a _green_ screen
            // B sets the framebuffer to a _blue_ screen
            // A sets the framebuffer to an _animating_ screen
            //
            // The R, G, B functions can be useful to make sure the individual color channels come through correctly (e.g. not swapping R/B channels)
            // The A function can be useful to set the framerate
            if (e.Keysym == KeySym.Plus && !e.Pressed)
            {
                this.Width  *= 2;
                this.Height *= 2;
            }

            if (e.Keysym == KeySym.Minus && !e.Pressed)
            {
                this.Width  /= 2;
                this.Height /= 2;
            }

            if (e.Keysym == KeySym.r && !e.Pressed)
            {
                var temp = this.Width;
                this.Width  = this.Height;
                this.Height = temp;
            }

            if (e.Keysym == KeySym.R && !e.Pressed)
            {
                this.color = Color.Red;
            }

            if (e.Keysym == KeySym.B && !e.Pressed)
            {
                this.color = Color.Blue;
            }

            if (e.Keysym == KeySym.G && !e.Pressed)
            {
                this.color = Color.Green;
            }

            if (e.Keysym == KeySym.A && !e.Pressed)
            {
                this.color = Color.Transparent;
            }
        }
コード例 #8
0
        private void Globals_OnKeyChanged(object sender, KeyChangedEventArgs e)
        {
            Recorders_OnKeyChanged(sender, e);

            if (e.Cancel)
            {
                return;
            }

            //Unregister old shortcut.
            HotKeyCollection.Default.Remove(e.PreviousModifiers, e.PreviousKey);

            //Registers all shortcuts and updates the input gesture text.
            App.RegisterShortcuts();
        }
コード例 #9
0
 private void mFloorSet_KeyChanged(object sender, KeyChangedEventArgs e)
 {
     SendMessageToAllClient("Key " + e.ChangedRoom.ToString() + " " + e.ChangedRoom.KeyStatus.ToString());
 }
コード例 #10
0
 /// <summary>
 /// Raises the <see cref="KeyChanged"/> event.
 /// </summary>
 /// <param name="e">
 /// The event arguments.
 /// </param>
 protected void OnKeyChanged(KeyChangedEventArgs e)
 {
     var ev = this.KeyChanged;
     if (ev != null)
     {
         ev(this, e);
     }
 }
コード例 #11
0
        private void Session_KeyChanged(object sender, KeyChangedEventArgs e)
        {
            Keys key = (Keys)e.Keysym;

            OnAddLogEvent($"按键事件,Keysym:{e.Keysym}, Pressed:{e.Pressed}, 按键:{key}");
        }
コード例 #12
0
 private void DataSubset_KeyChanged(object sender, KeyChangedEventArgs e)
 {
 }
コード例 #13
0
 private void DataSet_KeyChanged(object sender, KeyChangedEventArgs e)
 {
     DataSubset.ForeignKeyValue = e.NewKey;
     DataSubset.Fill();
 }
コード例 #14
0
        private void Session_KeyChanged(object sender, KeyChangedEventArgs e)
        {
            Keys key = (Keys)e.Keysym;

            Console.WriteLine($"按键事件,Keysym:{e.Keysym}, Pressed:{e.Pressed}, 按键:{key}");
        }
コード例 #15
0
 protected void OnKeyChanged(KeyChangedEventArgs e)
 {
     RaiseKeyChanged(e);
 }
コード例 #16
0
 /// <summary>
 /// Raises the <see cref="KeyChanged"/> event.
 /// </summary>
 /// <param name="e">
 /// The event arguments.
 /// </param>
 protected void OnKeyChanged(KeyChangedEventArgs e)
 {
     this.KeyChanged?.Invoke(this, e);
 }
コード例 #17
0
        /// <summary>A
        /// Callback function for mouse updates.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">EventArgs</param>
        public void OnKeyboardUpdate(object sender, KeyChangedEventArgs e)
        {
            KeySym newState = e.Keysym;

            /* 키보드 모든 키 */
            if (e.Pressed)
            {
                switch (newState)
                {
                // 상수 : bvk파라메터

                case KeySym.A:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.B:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.C:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.E:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.G:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.H:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.I:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.J:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.K:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.L:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.M:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.N:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.O:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.P:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Q:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.R:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.S:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.T:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.U:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.V:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.W:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.X:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Y:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Z:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.a:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.b:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.c:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.d:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.e:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.f:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.g:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.h:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.i:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.j:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.k:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.l:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.m:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.n:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.o:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.p:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.q:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.r:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.s:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.t:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.u:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.v:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.w:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.x:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.y:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.z:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Backspace:
                    User32.Keybd_event(8, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Tab:
                    User32.Keybd_event(9, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.LineFeed:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Clear:
                    User32.Keybd_event(12, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Return:
                    User32.Keybd_event(13, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Pause:
                    User32.Keybd_event(19, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.ScrollLock:
                    User32.Keybd_event(145, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.SysReq:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Escape:
                    User32.Keybd_event(27, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Delete:
                    User32.Keybd_event(46, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Home:
                    User32.Keybd_event(36, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Left:
                    User32.Keybd_event(37, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Up:
                    User32.Keybd_event(38, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Right:
                    User32.Keybd_event(39, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Down:
                    User32.Keybd_event(40, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.PageUp:
                    User32.Keybd_event(33, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.PageDown:
                    User32.Keybd_event(34, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.End:
                    User32.Keybd_event(35, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Begin:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Select:
                    User32.Keybd_event(41, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Print:
                    User32.Keybd_event(44, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Execute:
                    User32.Keybd_event(43, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Insert:
                    User32.Keybd_event(45, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Undo:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Redo:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Menu:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Find:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Cancel:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Help:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Break:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.ModeSwitch:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Num_Lock:
                    User32.Keybd_event(144, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadSpace:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadTab:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadEnter:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadF1:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadF2:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadF3:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadF4:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadHome:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadLeft:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadUp:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadRight:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadDown:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadPageUp:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadPageDown:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadEnd:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadBegin:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadInsert:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadDelete:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadEqual:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadMultiply:
                    User32.Keybd_event(106, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadAdd:
                    User32.Keybd_event(107, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadSeparator:
                    User32.Keybd_event(108, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadSubtract:
                    User32.Keybd_event(109, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadDecimal:
                    User32.Keybd_event(110, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPadDivide:
                    User32.Keybd_event(111, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad0:
                    User32.Keybd_event(96, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad1:
                    User32.Keybd_event(97, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad2:
                    User32.Keybd_event(98, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad3:
                    User32.Keybd_event(99, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad4:
                    User32.Keybd_event(100, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad5:
                    User32.Keybd_event(101, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad6:
                    User32.Keybd_event(102, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad7:
                    User32.Keybd_event(103, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad8:
                    User32.Keybd_event(104, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumPad9:
                    User32.Keybd_event(105, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F1:
                    User32.Keybd_event(112, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F2:
                    User32.Keybd_event(113, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F3:
                    User32.Keybd_event(114, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F4:
                    User32.Keybd_event(115, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F5:
                    User32.Keybd_event(116, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F6:
                    User32.Keybd_event(117, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F7:
                    User32.Keybd_event(118, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F8:
                    User32.Keybd_event(119, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F9:
                    User32.Keybd_event(120, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F10:
                    User32.Keybd_event(121, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F11:
                    User32.Keybd_event(122, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F12:
                    User32.Keybd_event(123, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F13:
                    User32.Keybd_event(124, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F14:
                    User32.Keybd_event(125, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F15:
                    User32.Keybd_event(126, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F16:
                    User32.Keybd_event(127, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F17:
                    User32.Keybd_event(128, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F18:
                    User32.Keybd_event(129, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F19:
                    User32.Keybd_event(130, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F20:
                    User32.Keybd_event(131, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F21:
                    User32.Keybd_event(132, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F22:
                    User32.Keybd_event(133, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F23:
                    User32.Keybd_event(134, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.F24:
                    User32.Keybd_event(135, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.ShiftLeft:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.ShiftRight:         // 왼쪽 쉬프트
                    User32.Keybd_event(16, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.ControlLeft:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.ControlRight:       // 왼쪽 컨트롤
                    User32.Keybd_event(17, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.CapsLock:
                    User32.Keybd_event(20, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.ShiftLock:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.MetaLeft:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.MetaRight:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.AltLeft:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.AltRight:
                    User32.Keybd_event(18, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.SuperLeft:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.SuperRight:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.HyperLeft:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.HyperRight:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Space:
                    User32.Keybd_event(32, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Exclamation:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Quote:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.NumberSign:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Dollar:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Percent:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Ampersand:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Apostrophe:
                    User32.Keybd_event(222, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Plus:
                    User32.Keybd_event(187, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Comma:
                    User32.Keybd_event(188, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Minus:
                    User32.Keybd_event(189, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Period:
                    User32.Keybd_event(190, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Slash:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D0:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D1:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D2:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D3:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D4:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D5:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D6:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D7:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D8:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.D9:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Colon:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Semicolon:
                    User32.Keybd_event(186, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Less:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Equal:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Greater:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Question:
                    User32.Keybd_event(191, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.At:
                    User32.Keybd_event((uint)newState, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Hangul:
                    User32.Keybd_event(21, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Hanja:
                    User32.Keybd_event(25, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.AsciiTilde:     //물결표시
                    User32.Keybd_event(192, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.BracketLeft:    //대괄호 열기
                    User32.Keybd_event(219, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Bracketright:     //대괄호 닫기
                    User32.Keybd_event(221, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;

                case KeySym.Backslash:        //역슬래시
                    User32.Keybd_event(220, 0, (int)WinApiKeyEventFlags.KEYDOWN, 0);
                    break;
                }
            }
            else
            {
                switch (newState)    //keyup
                {
                case KeySym.ShiftRight:
                    User32.Keybd_event(16, 0, (int)(WinApiKeyEventFlags.KEYUP | WinApiKeyEventFlags.KEYDOWN), 0);
                    break;

                case KeySym.ControlRight:
                    User32.Keybd_event(17, 0, (int)(WinApiKeyEventFlags.KEYUP | WinApiKeyEventFlags.KEYDOWN), 0);
                    break;

                case KeySym.AltRight:
                    User32.Keybd_event(18, 0, (int)(WinApiKeyEventFlags.KEYUP | WinApiKeyEventFlags.KEYDOWN), 0);
                    break;

                case KeySym.CapsLock:
                    User32.Keybd_event(20, 0, (int)(WinApiKeyEventFlags.KEYUP | WinApiKeyEventFlags.KEYDOWN), 0);
                    break;
                }
            }
        }