コード例 #1
0
        public void SubmitInputs(object sender, RoutedEventArgs e)
        {
            Input tempInput = new Input();

            if ((bool)PressAndRelease.IsChecked)
            {
                tempInput = new MouseInput(MouseInputType.PRESS_AND_RELEASE, (bool)RightClick.IsChecked, Convert.ToInt16(NumberTextBox.Text));
            }
            else if ((bool)DoubleClick.IsChecked)
            {
                tempInput = new MouseInput(MouseInputType.DOUBLE_CLICK, (bool)RightClick.IsChecked);
            }
            else if ((bool)PressKey.IsChecked)
            {
                tempInput = new MouseInput(MouseInputType.PRESS_MOUSE_BUTTON, (bool)RightClick.IsChecked);
            }
            else if ((bool)ReleaseKey.IsChecked)
            {
                tempInput = new MouseInput(MouseInputType.RELEASE_MOUSE_BUTTON, (bool)RightClick.IsChecked);
            }
            else if ((bool)MouseMove.IsChecked)
            {
                tempInput = new MouseInput(MouseInputType.MOUSE_MOVE, int.Parse(XMovement.Text), int.Parse(YMovement.Text), 2);
            }

            userSetup.UpdateInput(instruction.id, tempInput);
            this.Close();
        }
コード例 #2
0
        public void SubmitInputs(object sender, RoutedEventArgs e)
        {
            Input tempInput = new Input();

            if ((bool)PressAndRelease.IsChecked)
            {
                tempInput = new KeyboardInput(1, false, int.Parse(NumberTextBox.Text), KeyboardInputType.PRESS_AND_RELEASE, hotKey);
            }
            else if ((bool)HoldKey.IsChecked)
            {
                tempInput = new KeyboardInput(1, false, int.Parse(NumberTextBox.Text), KeyboardInputType.PRESS_KEY, hotKey);
            }
            else if ((bool)ReleaseKey.IsChecked)
            {
                tempInput = new KeyboardInput(1, false, int.Parse(NumberTextBox.Text), KeyboardInputType.RELEASE_KEY, hotKey);
            }
            else if ((bool)ToggleKey.IsChecked)
            {
                tempInput = new KeyboardInput(1, false, int.Parse(NumberTextBox.Text), KeyboardInputType.TOGGLE_KEY, hotKey);
            }

            userSetup.UpdateInput(instruction.id, tempInput);
            this.Close();
        }