コード例 #1
0
        private void TouchedDown(object sender, PointerEventArgs e)
        {
            var x = Convert.ToUInt16(e.Position.X.Inbetween(0, 800) / 800.0 * ushort.MaxValue);
            var y = Convert.ToUInt16(e.Position.Y.Inbetween(0, 480) / 480.0 * ushort.MaxValue);

            var data = (uint)(x << 16) | (uint)(y << 0);

            var moveInfo = new InjectedInputMouseInfo
            {
                DeltaX       = x,
                DeltaY       = y,
                MouseData    = data,
                MouseOptions = InjectedInputMouseOptions.Move | InjectedInputMouseOptions.Absolute
            };

            var downInfo = new InjectedInputMouseInfo
            {
                DeltaX       = 0,
                DeltaY       = 0,
                MouseData    = data,
                MouseOptions = InjectedInputMouseOptions.LeftDown
            };

            _inputInjector.InjectMouseInput(new[] { moveInfo, downInfo });
        }
コード例 #2
0
        private uint GetPointerData(PointerEventArgs e)
        {
            var x = Convert.ToUInt16(e.Position.X.Inbetween(0, 800) / 800.0 * ushort.MaxValue);
            var y = Convert.ToUInt16(e.Position.Y.Inbetween(0, 480) / 480.0 * ushort.MaxValue);

            return((uint)(x << 16) | (uint)(y << 0));
        }
コード例 #3
0
        private void TouchedUp(object sender, PointerEventArgs e)
        {
            var x = Convert.ToUInt16(e.Position.X.Inbetween(0, 800) / 800.0 * ushort.MaxValue);
            var y = Convert.ToUInt16(e.Position.Y.Inbetween(0, 480) / 480.0 * ushort.MaxValue);

            var data = (uint)(x << 16) | (uint)(y << 0);

            var upInfo = new InjectedInputMouseInfo
            {
                DeltaX       = 0,
                DeltaY       = 0,
                MouseData    = data,
                MouseOptions = InjectedInputMouseOptions.LeftUp | InjectedInputMouseOptions.Absolute
            };

            _inputInjector.InjectMouseInput(upInfo.ToEnumerable());
        }