示例#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;
        }
示例#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);
 }
示例#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;
 }
示例#4
0
 public InstantBind(MouseWheelAction wheel, MouseWheelAction alternativeWheel)
     : this()
 {
     Wheel            = wheel;
     Type             = InstantControlType.MouseWheel;
     AlternativeWheel = alternativeWheel;
     AlternativeType  = InstantControlType.MouseWheel;
 }
示例#5
0
 public InstantBind(MouseWheelAction wheel, Key alternativeKey)
     : this()
 {
     Wheel           = wheel;
     Type            = InstantControlType.MouseWheel;
     AlternativeKey  = alternativeKey;
     AlternativeType = InstantControlType.Key;
 }
示例#6
0
 public InstantBind(MouseButton button, MouseWheelAction alternativeWheel)
     : this()
 {
     Button           = button;
     Type             = InstantControlType.MouseButton;
     AlternativeWheel = alternativeWheel;
     AlternativeType  = InstantControlType.MouseWheel;
 }
示例#7
0
 public InstantBind(Key key, MouseWheelAction wheelAction)
     : this()
 {
     Key              = key;
     Type             = InstantControlType.Key;
     AlternativeWheel = wheelAction;
     AlternativeType  = InstantControlType.MouseWheel;
 }
示例#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);
 }
示例#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));
 }
示例#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);
     }
 }
示例#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));
        }
示例#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();
        }
示例#13
0
 public MouseWheelGesture()
     : base(MouseAction.WheelClick)
 {
     mouseWheelAction = MouseWheelAction.AllMovement;
 }
示例#14
0
 public static string GetName(MouseWheelAction wheelAction)
 {
     return(mouseWheel[wheelAction]);
 }
示例#15
0
 public InstantBind(MouseWheelAction wheelAction)
     : this()
 {
     Wheel = wheelAction;
     Type  = InstantControlType.MouseWheel;
 }
示例#16
0
 /// <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;
 }
示例#17
0
 /// <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;
 }
示例#18
0
 private void Control_MouseWheel(object sender, MouseEventArgs e)
 {
     MouseWheelAction?.Invoke(sender, e);
 }
示例#19
0
 public MouseWheelGesture()
     : base(MouseAction.WheelClick)
 {
     mouseWheelAction = MouseWheelAction.AllMovement;
 }
示例#20
0
 public MouseWheelGesture(MouseWheelAction action)
     : base(MouseAction.WheelClick)
 {
     this.mouseWheelAction = action;
 }