Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseSpeedIndicatorDefinition" /> class.
 /// </summary>
 /// <param name="id">The identifier of the key.</param>
 /// <param name="location">The location.</param>
 /// <param name="radius">The radius.</param>
 /// <param name="manipulation">The current element manipulation.</param>
 private MouseSpeedIndicatorDefinition(int id, TPoint location, int radius, ElementManipulation manipulation)
 {
     this.Id                  = id;
     this.Location            = location;
     this.Radius              = radius;
     this.CurrentManipulation = manipulation;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DirectInputAxisDefinition" /> class.
 /// </summary>
 /// <param name="id">The identifier of the key.</param>
 /// <param name="boundaries">The boundaries.</param>
 /// <param name="normalText">The normal text.</param>
 /// <param name="shiftText">The shift text.</param>
 /// <param name="changeOnCaps">Whether to change to shift text on caps lock.</param>
 /// <param name="textPosition">The new text position.
 /// If not provided, the new position will be recalculated from the bounding box of the key.</param>
 /// <param name="manipulation">The current manipulation.</param>
 public DirectInputAxisDefinition(
     int id,
     List <TPoint> boundaries,
     string normalText,
     string shiftText,
     Guid deviceId,
     bool changeOnCaps,
     string axisOne,
     string axisTwo,
     int axisOneMax,
     int axisTwoMax,
     int stickWidth,
     int stickHeight,
     int invertAxisOne,
     int invertAxisTwo,
     TPoint textPosition = null,
     ElementManipulation manipulation = null) : base(id, boundaries, normalText, deviceId, textPosition, manipulation)
 {
     this.ShiftText     = shiftText;
     this.AxisOne       = axisOne;
     this.AxisTwo       = axisTwo;
     this.AxisOneMax    = axisOneMax;
     this.AxisTwoMax    = axisTwoMax;
     this.StickWidth    = stickWidth;
     this.StickHeight   = stickHeight;
     this.InvertAxisOne = invertAxisOne;
     this.InvertAxisTwo = invertAxisTwo;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseScrollDefinition" /> class.
 /// </summary>
 /// <param name="id">The identifier of the key.</param>
 /// <param name="boundaries">The boundaries.</param>
 /// <param name="keyCode">The keycode.</param>
 /// <param name="text">The text of the key.</param>
 /// <param name="textPosition">The new text position.
 /// If not provided, the new position will be recalculated from the bounding box of the key.</param>
 /// <param name="manipulation">The current manipulation.</param>
 public MouseScrollDefinition(
     int id,
     List <TPoint> boundaries,
     int keyCode,
     string text,
     TPoint textPosition = null,
     ElementManipulation manipulation = null)
     : base(id, boundaries, keyCode.Singleton(), text, textPosition, manipulation)
 {
 }
Exemple #4
0
 /// <summary>
 /// Sets the new manipulation for this element.
 /// </summary>
 /// <param name="manipulation">The new manipulation.</param>
 /// <param name="preview">Whether or not it is a previe manipulation.</param>
 protected void SetManipulation(ElementManipulation manipulation, bool preview)
 {
     if (preview)
     {
         this.PreviewManipulation = manipulation;
     }
     else
     {
         this.CurrentManipulation = manipulation;
         this.PreviewManipulation = null;
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="KeyboardKeyDefinition" /> class.
 /// </summary>
 /// <param name="id">The identifier of the key.</param>
 /// <param name="boundaries">The boundaries.</param>
 /// <param name="keyCodes">The keycodes.</param>
 /// <param name="normalText">The normal text.</param>
 /// <param name="shiftText">The shift text.</param>
 /// <param name="changeOnCaps">Whether to change to shift text on caps lock.</param>
 /// <param name="textPosition">The new text position.
 /// If not provided, the new position will be recalculated from the bounding box of the key.</param>
 /// <param name="manipulation">The current manipulation.</param>
 public KeyboardKeyDefinition(
     int id,
     List <TPoint> boundaries,
     List <int> keyCodes,
     string normalText,
     string shiftText,
     bool changeOnCaps,
     TPoint textPosition = null,
     ElementManipulation manipulation = null) : base(id, boundaries, keyCodes, normalText, textPosition, manipulation)
 {
     this.ShiftText    = shiftText;
     this.ChangeOnCaps = changeOnCaps;
 }
Exemple #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DirectInputButtonDefinition" /> class.
        /// </summary>
        /// <param name="id">The identifier of the key.</param>
        /// <param name="normalText">The normal text.</param>
        /// <param name="shiftText">The shift text.</param>
        /// <param name="changeOnCaps">Whether to change to shift text on caps lock.</param>
        /// <param name="textPosition">The new text position.
        /// If not provided, the new position will be recalculated from the bounding box of the key.</param>
        /// <param name="manipulation">The current manipulation.</param>
        public DirectInputButtonDefinition(
            int id,
            List <TPoint> boundaries,
            string normalText,
            string shiftText,
            Guid deviceId,
            int buttonNumber,
            bool changeOnCaps,
            TPoint textPosition = null,
            ElementManipulation manipulation = null) : base(id, boundaries, normalText, deviceId, textPosition, manipulation)
        {
            this.ButtonNumber = buttonNumber;

            if (!PropertiesInitialized)
            {
                InitializeSubProperties();
            }
        }
Exemple #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KeyDefinition" /> class.
        /// </summary>
        /// <param name="id">The identifier of the key.</param>
        /// <param name="boundaries">The boundaries.</param>
        /// <param name="keyCodes">The keycodes.</param>
        /// <param name="text">The text of the key.</param>
        /// <param name="textPosition">The new text position.
        /// If not provided, the new position will be recalculated from the bounding box of the key.</param>
        /// <param name="manipulation">The current manipulation.</param>
        protected KeyDefinition(
            int id,
            List <TPoint> boundaries,
            List <int> keyCodes,
            string text,
            TPoint textPosition = null,
            ElementManipulation manipulation = null)
        {
            this.Id                  = id;
            this.Boundaries          = boundaries;
            this.KeyCodes            = keyCodes;
            this.Text                = text;
            this.CurrentManipulation = manipulation;

            var bb = this.GetBoundingBoxImpl();

            // TODO: Re-calculate text position based on its previous value.
            this.TextPosition = textPosition ?? (TPoint)bb.Location + new Size(bb.Width / 2, bb.Height / 2);
        }
Exemple #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DirectInputDpadDefinition" /> class.
        /// </summary>
        /// <param name="id">The identifier of the key.</param>
        /// <param name="normalText">The normal text.</param>
        /// <param name="shiftText">The shift text.</param>
        /// <param name="changeOnCaps">Whether to change to shift text on caps lock.</param>
        /// <param name="textPosition">The new text position.
        /// If not provided, the new position will be recalculated from the bounding box of the key.</param>
        /// <param name="manipulation">The current manipulation.</param>
        public DirectInputDpadDefinition(
            int id,
            List <TPoint> boundaries,
            string normalText,
            string shiftText,
            Guid deviceId,
            int dpadNumber,
            bool changeOnCaps,
            bool drawDiagonalDirections,
            TPoint textPosition = null,
            ElementManipulation manipulation = null) : base(id, boundaries, normalText, deviceId, textPosition, manipulation)
        {
            this.DpadNumber             = dpadNumber;
            this.DrawDiagonalDirections = drawDiagonalDirections;

            if (!PropertiesInitialized)
            {
                InitializeSubProperties();
            }
        }