示例#1
0
        void Current_KeyEventLowLevel(KeyCombination keyCombination)
        {
            checkBoxKeyboardControl.Checked = false;
            checkBoxKeyboardShift.Checked   = false;
            checkBoxKeyboardAlt.Checked     = false;
            checkBoxKeyboardLWin.Checked    = false;
            checkBoxKeyboardRWin.Checked    = false;
            foreach (KeysWithExtended key in keyCombination.Modifiers)
            {
                if (key.IsControlKey)
                {
                    checkBoxKeyboardControl.Checked = true;
                }
                if (key.IsShiftKey)
                {
                    checkBoxKeyboardShift.Checked = true;
                }
                if (key.IsAltKey)
                {
                    checkBoxKeyboardAlt.Checked = true;
                }
                if (key.IsLWinKey)
                {
                    checkBoxKeyboardLWin.Checked = true;
                }
                if (key.IsRWinKey)
                {
                    checkBoxKeyboardRWin.Checked = true;
                }
            }

            comboBoxKeyboardKey.Text         = NiceKeyName.GetName(keyCombination.KeyWithExtended.Keys);
            checkBoxKeyboardExtended.Checked = keyCombination.KeyWithExtended.Extended;
        }
示例#2
0
        private void ActionPropertiesDialog_Load(object sender, EventArgs e)
        {
            if (Action != null)
            {
                // Launch Application
                textBoxLaunchApplication.Text = Action.LaunchApplication.Command;
                if (Action.LaunchApplication.WaitForInputIdle)
                {
                    radioButtonLaunchApplicationWaitForInputIdle.Checked = true;
                }
                else if (Action.LaunchApplication.WaitForExit)
                {
                    radioButtonLaunchApplicationWaitForExit.Checked = true;
                }
                else
                {
                    radioButtonLaunchApplicationDoNotWait.Checked = true;
                }

                // Keyboard
                checkBoxKeyboardControl.Checked  = Action.Keyboard.Control;
                checkBoxKeyboardShift.Checked    = Action.Keyboard.Shift;
                checkBoxKeyboardAlt.Checked      = Action.Keyboard.Alt;
                checkBoxKeyboardLWin.Checked     = Action.Keyboard.LWin;
                checkBoxKeyboardRWin.Checked     = Action.Keyboard.RWin;
                comboBoxKeyboardKey.Text         = NiceKeyName.GetName(Action.Keyboard.VirtualKey);
                checkBoxKeyboardExtended.Checked = Action.Keyboard.Extended;
                numericUpDown1.Value             = Action.Keyboard.RepeatCount;

                // Window Message
                textBoxProcessName.Text = Action.WindowMessage.ProcessName;
                textBoxWindowName.Text  = Action.WindowMessage.WindowName;
                textBoxWindowClass.Text = Action.WindowMessage.WindowClass;
                if (Action.WindowMessage.NotFoundAction == SettingsKeyboardKeyActionType.WindowMessage)
                {
                    comboBoxNotFound.Text = "do nothing";
                }
                else
                {
                    comboBoxNotFound.Text = Action.WindowMessage.NotFoundAction.ToString();
                }
                textBoxMessageID.Text = Action.WindowMessage.Message.ToString();
                textBoxWParam.Text    = Action.WindowMessage.WParam.ToString();
                textBoxLParam.Text    = Action.WindowMessage.LParam.ToString();

                // Active tab
                foreach (TabPage page in tabControl1.TabPages)
                {
                    if ((SettingsKeyboardKeyActionType)page.Tag == Action.ActionType)
                    {
                        tabControl1.SelectedTab = page;
                    }
                }
            }
            else
            {
                tabControl1.Enabled = false;
            }
        }
示例#3
0
 public override string ToString()
 {
     if (this.Extended)
     {
         return("^" + NiceKeyName.GetName(this.Keys));
     }
     else
     {
         return(NiceKeyName.GetName(this.Keys));
     }
 }