Esempio n. 1
0
        private void Processor_PointerMoved(object sender, TouchPanels.PointerEventArgs e)
        {
            if (Util.BrightnessControl.GetInstance().Level == 0)
            {
                return;
            }
            List <InjectedInputTouchInfo> PMove = new List <InjectedInputTouchInfo>()
            {
                new InjectedInputTouchInfo()
                {
                    Contact     = inputRectangle,
                    PointerInfo = new InjectedInputPointerInfo()
                    {
                        PointerId     = _pID,
                        PixelLocation = new InjectedInputPoint()
                        {
                            PositionX = (int)e.Position.X, PositionY = (int)e.Position.Y
                        },
                        PointerOptions = InjectedInputPointerOptions.InContact |
                                         InjectedInputPointerOptions.InRange |
                                         InjectedInputPointerOptions.PointerDown,
                        TimeOffsetInMilliseconds = 0
                    },
                    Pressure        = e.Pressure / 255f,
                    TouchParameters = InjectedInputTouchParameters.Pressure |
                                      InjectedInputTouchParameters.Contact
                }
            };

            _injector.InjectTouchInput(PMove);
        }
Esempio n. 2
0
        private void Processor_PointerDown(object sender, TouchPanels.PointerEventArgs e)
        {
            //Reset timeout for backlight
            Util.BrightnessControl.GetInstance().ResetTimeout();
            if (Util.BrightnessControl.GetInstance().Level == 0)
            {
                return;
            }
            _injector = InputInjector.TryCreate();
            _injector.InitializeTouchInjection(InjectedInputVisualizationMode.Indirect);
            List <InjectedInputTouchInfo> PDown = new List <InjectedInputTouchInfo>()
            {
                new InjectedInputTouchInfo()
                {
                    Contact     = inputRectangle,
                    PointerInfo = new InjectedInputPointerInfo()
                    {
                        PointerId     = _pID,
                        PixelLocation = new InjectedInputPoint()
                        {
                            PositionX = (int)e.Position.X, PositionY = (int)e.Position.Y
                        },
                        PointerOptions = InjectedInputPointerOptions.InContact |
                                         InjectedInputPointerOptions.InRange |
                                         InjectedInputPointerOptions.PointerDown,
                        TimeOffsetInMilliseconds = 0
                    },
                    Pressure        = e.Pressure / 255f,
                    TouchParameters = InjectedInputTouchParameters.Pressure |
                                      InjectedInputTouchParameters.Contact
                }
            };

            _injector.InjectTouchInput(PDown);
        }
Esempio n. 3
0
        private void Processor_PointerUp(object sender, TouchPanels.PointerEventArgs e)
        {
            if (Util.BrightnessControl.GetInstance().Level == 0)
            {
                return;
            }
            List <InjectedInputTouchInfo> PUp = new List <InjectedInputTouchInfo>()
            {
                new InjectedInputTouchInfo()
                {
                    PointerInfo = new InjectedInputPointerInfo()
                    {
                        PointerId      = _pID++,
                        PointerOptions = InjectedInputPointerOptions.PointerUp
                    }
                }
            };

            _injector.InjectTouchInput(PUp);
            _injector.UninitializeTouchInjection();
        }
Esempio n. 4
0
        private void Processor_PointerMoved(object sender, TouchPanels.PointerEventArgs e)
        {
            WriteStatus(e, "Moved");
            if (currentScrollItem != null)
            {
                double dx = e.Position.X - lastPosition.X;
                double dy = e.Position.Y - lastPosition.Y;
                if (!currentScrollItem.HorizontallyScrollable)
                {
                    dx = 0;
                }
                if (!currentScrollItem.VerticallyScrollable)
                {
                    dy = 0;
                }

                Windows.UI.Xaml.Automation.ScrollAmount h = Windows.UI.Xaml.Automation.ScrollAmount.NoAmount;
                Windows.UI.Xaml.Automation.ScrollAmount v = Windows.UI.Xaml.Automation.ScrollAmount.NoAmount;
                if (dx < 0)
                {
                    h = Windows.UI.Xaml.Automation.ScrollAmount.SmallIncrement;
                }
                else if (dx > 0)
                {
                    h = Windows.UI.Xaml.Automation.ScrollAmount.SmallDecrement;
                }
                if (dy < 0)
                {
                    v = Windows.UI.Xaml.Automation.ScrollAmount.SmallIncrement;
                }
                else if (dy > 0)
                {
                    v = Windows.UI.Xaml.Automation.ScrollAmount.SmallDecrement;
                }
                currentScrollItem.Scroll(h, v);
            }
            lastPosition = e.Position;
        }
        private void Processor_PointerMoved(object sender, TouchPanels.PointerEventArgs e)
        {
            if (_currentScrollItem != null)
            {
                var dx = e.Position.X - _lastPosition.X;
                var dy = e.Position.Y - _lastPosition.Y;
                if (!_currentScrollItem.HorizontallyScrollable)
                {
                    dx = 0;
                }
                if (!_currentScrollItem.VerticallyScrollable)
                {
                    dy = 0;
                }

                var h = Windows.UI.Xaml.Automation.ScrollAmount.NoAmount;
                var v = Windows.UI.Xaml.Automation.ScrollAmount.NoAmount;
                if (dx < 0)
                {
                    h = Windows.UI.Xaml.Automation.ScrollAmount.SmallIncrement;
                }
                else if (dx > 0)
                {
                    h = Windows.UI.Xaml.Automation.ScrollAmount.SmallDecrement;
                }
                if (dy < 0)
                {
                    v = Windows.UI.Xaml.Automation.ScrollAmount.SmallIncrement;
                }
                else if (dy > 0)
                {
                    v = Windows.UI.Xaml.Automation.ScrollAmount.SmallDecrement;
                }
                _currentScrollItem.Scroll(h, v);
            }
            _lastPosition = e.Position;
        }
 private void Processor_PointerDown(object sender, TouchPanels.PointerEventArgs e)
 {
     _currentScrollItem = FindElementsToInvoke(e.Position);
     _lastPosition      = e.Position;
 }
 private void Processor_PointerUp(object sender, TouchPanels.PointerEventArgs e)
 {
     _currentScrollItem = null;
 }
Esempio n. 8
0
 private void WriteStatus(TouchPanels.PointerEventArgs args, string type)
 {
     //Status.Text = $"{type}\nPosition: {args.Position.X},{args.Position.Y}\nPressure:{args.Pressure}";
 }
Esempio n. 9
0
 private void Processor_PointerUp(object sender, TouchPanels.PointerEventArgs e)
 {
     WriteStatus(e, "Up");
     currentScrollItem = null;
 }