Tinkr2/4.2/AphelionCore/AphelionCore/Core/Core.cs
/// <summary>
/// Manually grab a touch from native touch controller.
/// </summary>
/// <param name="endTicks">Time in ticks when waiting for the event should be terminated (e.g. DateTime.Now.Ticks + l100Ms).</param>
/// <returns>
/// Returns the <see cref="TouchEventArgs"/> retrieved from the touchscreen.
/// If a timeout occurs the position of the return value is -1, -1.
/// </returns>
Manually grab a touch from native touch controller.
Manually grab a touch from native touch controller .
public static TouchEventArgs ManualTouchPoint(long endTicks)
      {
         while (true)
         {
            if (DateTime.Now.Ticks > endTicks)
            {
               return new TouchEventArgs(new point(-1, -1), 0);
            }
            int x = 0;
            int y = 0;
            TouchCollectorConfiguration.GetLastTouchPoint(ref x, ref y);
            if (x != 1022 && x > 0 || y != 1022 && y > 0)
            {
               if (!_instance._penDown)
               {
                  _instance._penDown = true;
                  _instance._lastX = x;
                  _instance._lastY = y;
                  return new TouchEventArgs(new point(x, y), 0);
               }
            }
            else
            {
               if (_instance._penDown)
               {
                  _instance._penDown = false;
                  return new TouchEventArgs(new point(_instance._lastX, _instance._lastY), 1);
               }
            }
            Thread.Sleep(5);
         }
      }
public static TouchEventArgs ManualTouchPoint ( long endTicks ) { while ( true ) { if ( DateTime . Now . Ticks > endTicks ) { return new TouchEventArgs ( new point ( - 1 , - 1 ) , 0 ) ; } int x = 0 ; int y = 0 ; TouchCollectorConfiguration . GetLastTouchPoint ( ref x , ref y ) ; if ( x != 1022 && x > 0 || y != 1022 && y > 0 ) { if ( ! _instance . _penDown ) { _instance . _penDown = true ; _instance . _lastX = x ; _instance . _lastY = y ; return new TouchEventArgs ( new point ( x , y ) , 0 ) ; } } else { if ( _instance . _penDown ) { _instance . _penDown = false ; return new TouchEventArgs ( new point ( _instance . _lastX , _instance . _lastY ) , 1 ) ; } } Thread . Sleep ( 5 ) ; } }
Manually grab a touch from native touch controller.
Manually grab a touch from native touch controller .
// Check the Pen //_instance._x = x; //_instance._y = y; // Pen down // Pen Down // Pen Tapped
Returns the  retrieved from the touchscreen.
If a timeout occurs the position of the return value is -1, -1.
Returns the retrieved from the touchscreen . If a timeout occurs the position of the return value is - 1 - 1 .
endTicks
long
Time in ticks when waiting for the event should be terminated .
Time in ticks when waiting for the event should be terminated .