Exemple #1
0
        private void _globalKeyboardHook_KeyboardP(object sender, GlobalKeyboardHookEventArgs e)
        {
            if (!_globalKeyboardHook.IsThisForm(this))
            {
                return;
            }
            int key = _globalKeyboardHook.KeyCode;

            if (key == (int)BasicClassLibrary.Shortcut.ShiftF1)
            {
                nPicHeightFactor.Value--;
            }
            else if (key == (int)BasicClassLibrary.Shortcut.F1)
            {
                nPicHeightFactor.Value++;
            }
            else if (key == (int)BasicClassLibrary.Shortcut.ShiftF2)
            {
                nPicWidth.Value--;
            }
            else if (key == (int)BasicClassLibrary.Shortcut.F2)
            {
                nPicWidth.Value++;
            }
            else if (key == (int)BasicClassLibrary.Shortcut.ESC)
            {
                Close();
            }
            else if (key == (int)BasicClassLibrary.Shortcut.F5)
            {
                SetFact();
                piclist.IncreaseWidth(0);
                piclist.RefreshList(ActPicStart, ActPicStart + ShowCount - 1);
            }
            else if (key == (int)BasicClassLibrary.Shortcut.ArrowLeft)
            {
                StepBack();
            }
            else if ((key == (int)BasicClassLibrary.Shortcut.ArrowRight) || (key == (int)BasicClassLibrary.Shortcut.SPACE))
            {
                StepForward(true);
            }
            else if (key == (int)BasicClassLibrary.Shortcut.CtrlLeftArrow)
            {
                nPicWidth.Value -= 1;
            }
            else if (key == (int)BasicClassLibrary.Shortcut.CtrlRightArrow)
            {
                nPicWidth.Value += 1;
            }
            else if (key == (int)BasicClassLibrary.Shortcut.CtrlDownArrow)
            {
                nPicHeightFactor.Value += 1;
            }
            else if (key == (int)BasicClassLibrary.Shortcut.CtrlUpArrow)
            {
                nPicHeightFactor.Value -= 1;
            }
            else if (key == (int)BasicClassLibrary.Shortcut.ESC)
            {
                e.Handled = true;
                Close();
            }
            else if (key == (int)BasicClassLibrary.Shortcut.CtrlM)
            {
                Metronom();
            }
            else if (key == (int)BasicClassLibrary.Shortcut.CtrlA)
            {
                AutoStep();
            }
            e.Handled = true;
        }