Exemplo n.º 1
0
        private void ToUIConfiguration()
        {
            txtName.Text          = profile.Name;
            txtAspectX.Text       = selectedResolution.LeftAnalog.AspectRatioX.ToString();
            txtAspectY.Text       = selectedResolution.LeftAnalog.AspectRatioY.ToString();
            txtRadius.Text        = selectedResolution.LeftAnalog.Radius.ToString();
            chkFixed.Checked      = selectedResolution.LeftAnalog.FixedRadius;
            chkPressed.Checked    = selectedResolution.LeftAnalog.KeepPressed;
            chkSpringMode.Checked = selectedResolution.LeftAnalog.SpringMode;
            txtInnerRadius.Text   = selectedResolution.LeftAnalog.InnerRadius.ToString();
            txtDeadzone.Text      = selectedResolution.LeftAnalog.DeadZone.ToString();
            if (selectedResolution.LeftAnalog.Button != null)
            {
                if (!string.IsNullOrEmpty(selectedResolution.LeftAnalog.Button.Key))
                {
                    cbMouseKeyboard.SelectedItem = (ARPGGamepadCore.KeyboardKeys)ARPGGamepadKeys.GetLetterKey(selectedResolution.LeftAnalog.Button.Key);
                }
                else
                {
                    cbMouseKeyboard.SelectedItem = ARPGGamepadCore.KeyboardKeys.None;
                }
                cbMouseButton.SelectedItem   = selectedResolution.LeftAnalog.Button.MouseClick;
                cbMouseModifier.SelectedItem = selectedResolution.LeftAnalog.Button.Modifier;
            }
            txtOffsetX.Text = selectedResolution.LeftAnalog.OffsetX.ToString();
            txtOffsetY.Text = selectedResolution.LeftAnalog.OffsetY.ToString();

            txtRAspectX.Text     = selectedResolution.RightAnalog.AspectRatioX.ToString();
            txtRAspectY.Text     = selectedResolution.RightAnalog.AspectRatioY.ToString();
            txtRRadius.Text      = selectedResolution.RightAnalog.Radius.ToString();
            chkRFixed.Checked    = selectedResolution.RightAnalog.FixedRadius;
            chkRPressed.Checked  = selectedResolution.RightAnalog.KeepPressed;
            txtRInnerRadius.Text = selectedResolution.RightAnalog.InnerRadius.ToString();
            txtRDeadzone.Text    = selectedResolution.RightAnalog.DeadZone.ToString();
            if (selectedResolution.RightAnalog.Button != null)
            {
                if (!string.IsNullOrEmpty(selectedResolution.RightAnalog.Button.Key))
                {
                    cbRMouseKeyboard.SelectedItem = (ARPGGamepadCore.KeyboardKeys)ARPGGamepadKeys.GetLetterKey(selectedResolution.RightAnalog.Button.Key);
                }
                else
                {
                    cbRMouseKeyboard.SelectedItem = ARPGGamepadCore.KeyboardKeys.None;
                }
                cbRMouseButton.SelectedItem   = selectedResolution.RightAnalog.Button.MouseClick;
                cbRMouseModifier.SelectedItem = selectedResolution.RightAnalog.Button.Modifier;
            }
            txtROffsetX.Text = selectedResolution.RightAnalog.OffsetX.ToString();
            txtROffsetY.Text = selectedResolution.RightAnalog.OffsetY.ToString();
        }
Exemplo n.º 2
0
 public void SendKeyUp(string key, MouseClick mouse, Modifiers modifier)
 {
     if (mouse != MouseClick.None)
     {
         SendClickUp(mouse);
     }
     if (!String.IsNullOrEmpty(key))
     {
         keybd_event((byte)ARPGGamepadKeys.GetLetterKey(key), 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
     }
     if (modifier != Modifiers.None)
     {
         SendModifierUp(modifier);
     }
 }
Exemplo n.º 3
0
        private void lstButtons_SelectedIndexChanged(object sender, EventArgs e)
        {
            var list = sender as ListBox;

            if (list != null)
            {
                var buttonConfig = list.SelectedValue as ButtonConfig;

                if (buttonConfig != null)
                {
                    if (!string.IsNullOrEmpty(buttonConfig.Key))
                    {
                        cboKey.SelectedItem = (ARPGGamepadCore.KeyboardKeys)ARPGGamepadKeys.GetLetterKey(buttonConfig.Key);
                    }
                    else
                    {
                        cboKey.SelectedItem = ARPGGamepadCore.KeyboardKeys.None;
                    }
                    cboMouse.SelectedItem    = buttonConfig.MouseClick;
                    cboModifier.SelectedItem = buttonConfig.Modifier;
                    chkToggle.Checked        = buttonConfig.Toggle;
                }
            }
        }