Example #1
0
        private void Load()
        {
            _mouseWheelAction = MouseWheelActionOriginal;

            var keys = _settingsProvider.Get(SettingsConstants.KeyMap, DefaultSettings.KeyMap);

            _keys = new List <KeyCombinationItem>();
            foreach (var pair in keys)
            {
                _keys.Add(new KeyCombinationItem
                {
                    Key            = pair.Key,
                    KeyCombination = pair.Value
                });
            }

            _defaultKeys = new List <KeyCombinationItem>();
            foreach (var pair in DefaultSettings.KeyMap)
            {
                _defaultKeys.Add(new KeyCombinationItem
                {
                    Key            = pair.Key,
                    KeyCombination = pair.Value
                });
            }

            _originalKeys = keys;
        }
Example #2
0
 private void ReadSettings()
 {
     _topMost      = _settingsProvider.Get(SettingsConstants.TopMost, DefaultSettings.TopMost);
     _centerWindow = _settingsProvider.Get(SettingsConstants.CenterWindow, DefaultSettings.CenterWindow);
     ReadKeyCombinations();
     _mouseWheelAction = _settingsProvider.Get(SettingsConstants.MouseWheelAction, DefaultSettings.MouseWheekAction);
 }
Example #3
0
 /// <summary>
 /// Initialize a new instance of the <see cref="MouseHookEventArgs"/> class.
 /// </summary>
 /// <param name="coords">the coordonates of the mouse.</param>
 /// <param name="deltaCoords">the delta coordonates of the mouse.</param>
 /// <param name="mouseAction">which button has been pressed.</param>
 /// <param name="mouseWheelAction">whether the wheel is going up or down.</param>
 /// <param name="time">the date time of the event.</param>
 internal MouseHookEventArgs(Point coords, Point deltaCoords, MouseAction mouseAction, MouseWheelAction mouseWheelAction, long time)
 {
     Coords      = coords;
     DeltaCoords = deltaCoords;
     Action      = mouseAction;
     WheelAction = mouseWheelAction;
     Time        = time;
 }
Example #4
0
 public InstantBind(MouseWheelAction wheel, MouseWheelAction alternativeWheel)
     : this()
 {
     Wheel            = wheel;
     Type             = InstantControlType.MouseWheel;
     AlternativeWheel = alternativeWheel;
     AlternativeType  = InstantControlType.MouseWheel;
 }
Example #5
0
 public InstantBind(MouseWheelAction wheel, Key alternativeKey)
     : this()
 {
     Wheel           = wheel;
     Type            = InstantControlType.MouseWheel;
     AlternativeKey  = alternativeKey;
     AlternativeType = InstantControlType.Key;
 }
Example #6
0
 public InstantBind(MouseButton button, MouseWheelAction alternativeWheel)
     : this()
 {
     Button           = button;
     Type             = InstantControlType.MouseButton;
     AlternativeWheel = alternativeWheel;
     AlternativeType  = InstantControlType.MouseWheel;
 }
Example #7
0
 public InstantBind(Key key, MouseWheelAction wheelAction)
     : this()
 {
     Key              = key;
     Type             = InstantControlType.Key;
     AlternativeWheel = wheelAction;
     AlternativeType  = InstantControlType.MouseWheel;
 }
Example #8
0
 public MapMouseWheelForm(PadTieForm mainForm, Controller cc, MouseWheelAction editing) :
     this(mainForm, cc)
 {
     this.editing         = editing;
     motion.Text          = editing.Value.ToString();
     continuous.Checked   = editing.Continuous;
     useIntensity.Checked = editing.UseIntensity;
     slotCapture.SetInput(editing.SlotDescription, true);
 }
Example #9
0
 public override void WriteXml(XmlWriter writer)
 {
     base.WriteXml(writer);
     writer.WriteElementString("KnobImage", KnobImage);
     writer.WriteElementString("RotationStep", RotationStep.ToString(CultureInfo.InvariantCulture));
     writer.WriteElementString("StepValue", StepValue.ToString(CultureInfo.InvariantCulture));
     writer.WriteElementString("InitialRotation", InitialRotation.ToString(CultureInfo.InvariantCulture));
     writer.WriteStartElement("ClickType");
     writer.WriteElementString("Type", ClickType.ToString());
     if (ClickType == Controls.ClickType.Swipe)
     {
         writer.WriteElementString("Sensitivity", SwipeSensitivity.ToString(CultureInfo.InvariantCulture));
     }
     writer.WriteEndElement();
     writer.WriteElementString("MouseWheel", MouseWheelAction.ToString(CultureInfo.InvariantCulture));
 }
Example #10
0
 private void _settingsProvider_SettingChanged(object sender, SettingChangeEventArgs e)
 {
     if (e.SettingName.Equals(SettingsConstants.TopMost, StringComparison.InvariantCultureIgnoreCase))
     {
         TopMost = _settingsProvider.Get(SettingsConstants.TopMost, DefaultSettings.TopMost);
     }
     else if (e.SettingName.Equals(SettingsConstants.CenterWindow, StringComparison.InvariantCultureIgnoreCase))
     {
         CenterWindow = _settingsProvider.Get(SettingsConstants.CenterWindow, DefaultSettings.CenterWindow);
     }
     else if (e.SettingName.Equals(SettingsConstants.KeyMap, StringComparison.InvariantCultureIgnoreCase))
     {
         ReadKeyCombinations();
     }
     else if (e.SettingName.Equals(SettingsConstants.MouseWheelAction, StringComparison.InvariantCultureIgnoreCase))
     {
         _mouseWheelAction = _settingsProvider.Get(SettingsConstants.MouseWheelAction, DefaultSettings.MouseWheekAction);
     }
 }
Example #11
0
        public override void WriteXml(XmlWriter writer)
        {
            TypeConverter colorConverter = TypeDescriptor.GetConverter(typeof(Color));

            base.WriteXml(writer);
            writer.WriteElementString("KnobImage", KnobImage);
            writer.WriteStartElement("Positions");
            foreach (RotarySwitchPosition position in Positions)
            {
                writer.WriteStartElement("Position");
                writer.WriteAttributeString("Name", position.Name);
                writer.WriteAttributeString("Rotation", position.Rotation.ToString(CultureInfo.InvariantCulture));
                writer.WriteEndElement();
            }
            writer.WriteEndElement();
            writer.WriteElementString("DefaultPosition", DefaultPosition.ToString(CultureInfo.InvariantCulture));
            if (DrawLines)
            {
                writer.WriteStartElement("Lines");
                writer.WriteElementString("Thickness", LineThickness.ToString(CultureInfo.InvariantCulture));
                writer.WriteElementString("Length", LineLength.ToString(CultureInfo.InvariantCulture));
                writer.WriteElementString("Color", colorConverter.ConvertToInvariantString(LineColor));
                writer.WriteEndElement();
            }
            if (DrawLabels)
            {
                writer.WriteStartElement("Labels");
                writer.WriteElementString("Color", colorConverter.ConvertToInvariantString(LabelColor));
                writer.WriteElementString("MaxWidth", MaxLabelWidth.ToString(CultureInfo.InvariantCulture));
                writer.WriteElementString("MaxHeight", MaxLabelHeight.ToString(CultureInfo.InvariantCulture));
                writer.WriteElementString("Distance", LabelDistance.ToString(CultureInfo.InvariantCulture));
                LabelFormat.WriteXml(writer);
                writer.WriteEndElement();
            }
            writer.WriteStartElement("ClickType");
            writer.WriteElementString("Type", ClickType.ToString());
            if (ClickType == Controls.ClickType.Swipe)
            {
                writer.WriteElementString("Sensitivity", SwipeSensitivity.ToString(CultureInfo.InvariantCulture));
            }
            writer.WriteEndElement();
            writer.WriteElementString("MouseWheel", MouseWheelAction.ToString(CultureInfo.InvariantCulture));
        }
Example #12
0
        private void okBtn_Click(object sender, EventArgs e)
        {
            short w;

            try {
                w = short.Parse(motion.Text);
            } catch (Exception) {
                MessageBox.Show("The wheel motion value must be a positive or negative whole number.");
                return;
            }

            if (slotCapture.Value == null)
            {
                MessageBox.Show("Please click Capture and press a button or axis direction on the gamepad.");
                return;
            }

            var input = slotCapture.Value;
            MouseWheelAction action;

            if (editing == null)
            {
                action = new MouseWheelAction(Controller.Core, w);
            }
            else
            {
                action       = editing;
                action.Value = w;
                if (action.SlotDescription != input)
                {
                    MapUtil.Map(MainForm, Controller.Virtual, action.SlotDescription, null);
                }
            }

            action.UseIntensity = useIntensity.Checked;
            action.Continuous   = continuous.Checked;

            MapUtil.Map(MainForm, Controller.Virtual, input, action);

            DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Example #13
0
 public MouseWheelGesture()
     : base(MouseAction.WheelClick)
 {
     mouseWheelAction = MouseWheelAction.AllMovement;
 }
Example #14
0
 public static string GetName(MouseWheelAction wheelAction)
 {
     return(mouseWheel[wheelAction]);
 }
Example #15
0
 public InstantBind(MouseWheelAction wheelAction)
     : this()
 {
     Wheel = wheelAction;
     Type  = InstantControlType.MouseWheel;
 }
 /// <summary>
 /// Initializes a new instance of the MouseWheelGesture class
 /// </summary>
 /// <param name="mouseWheelAction">The action associated with this gesture</param>
 /// <param name="modifiers">The modifiers associated with this gesture</param>
 public MouseWheelGesture(MouseWheelAction mouseWheelAction, ModifierKeys modifiers)
     : base(MouseAction.WheelClick, modifiers)
 {
     MouseWheelAction = mouseWheelAction;
 }
 /// <summary>
 /// Initializes a new instance of the MouseWheelGesture class
 /// </summary>
 /// <param name="mouseWheelAction">The action associated with this gesture</param>
 public MouseWheelGesture(MouseWheelAction mouseWheelAction)
     : base(MouseAction.WheelClick)
 {
     MouseWheelAction = mouseWheelAction;
 }
Example #18
0
 private void Control_MouseWheel(object sender, MouseEventArgs e)
 {
     MouseWheelAction?.Invoke(sender, e);
 }
 public MouseWheelGesture()
     : base(MouseAction.WheelClick)
 {
     mouseWheelAction = MouseWheelAction.AllMovement;
 }
 public MouseWheelGesture(MouseWheelAction action)
     : base(MouseAction.WheelClick)
 {
     this.mouseWheelAction = action;
 }