GestureRecognizer GestureRecognizer GestureRecognizer GestureRecognizer Class

Provides gesture and manipulation recognition, event listeners, and settings.

Syntax

Declaration

public sealed class GestureRecognizerpublic sealed class GestureRecognizerPublic NotInheritable Class GestureRecognizerpublic sealed class GestureRecognizer

Remarks

You can create a gesture object for each appropriate element when your app starts. However, this approach might not scale well depending on the number of gesture objects you need to create (for example, a jigsaw puzzle with hundreds of pieces).

In this case, you can create gesture objects dynamically on a pointerdown event and destroy them on an MSGestureEnd event. This approach scales well, but does incur some overhead due to creating and releasing these objects.

Alternatively, you can statically allocate and dynamically manage a pool of reusable gesture objects.

Note

: This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

For more detail on how to use cross-slide functionality, see Guidelines for cross-slide. The threshold distances used by the cross-slide interaction are shown in the following diagram.

Screen shot showing the select and drag and drop processes.

The PivotRadius and PivotCenter properties are used only when single pointer input is detected. They have no effect on multiple pointer input. The value for these properties should be updated regularly during the interaction.

Rotation is supported by a GestureRecognizer only when GestureSettings is set through the GestureSettings property.

Rotation is not supported for single pointer input if the value of PivotRadius is set to 0.

Examples

Here we set up a GestureRecognizer object with a collection of input event handlers for processing various pointer and gestures. For more information on how to listen to and handle Windows Runtime events, see .

Note

Use the target or currentTarget property of the event object instead of the GestureRecognizer object in the event handler.


// inputManager handles gesture recognition for this sample.
function inputManager(target) {
    // Initialize the gesture recognizer.
    var gr = new Windows.UI.Input.GestureRecognizer();

    // Turn off visual feedback for gestures.
    // Visual feedback for pointer input is still displayed. 
    gr.showGestureFeedback = false;

    // Configure gesture recognizer to process the following:
    // double tap               - start questions and timer.
    // tap                      - move to next question.
    // right tap                - show answer.
    // hold and hold with mouse - start clues.
    gr.gestureSettings =
        Windows.UI.Input.GestureSettings.tap |
        Windows.UI.Input.GestureSettings.doubleTap |
        Windows.UI.Input.GestureSettings.rightTap |
        Windows.UI.Input.GestureSettings.hold |
        Windows.UI.Input.GestureSettings.holdWithMouse;

    // Register event listeners for these gestures.
    gr.addEventListener('tapped', tappedHandler);
    gr.addEventListener("holding", holdingHandler);
    gr.addEventListener("righttapped", rightTappedHandler);

    // Register event listeners for DOM pointer events.
    // The event pointer(s) are passed to the gesture recognizer
    // for further processing.
    target.addEventListener('MSPointerDown', pointerDown, false);
    target.addEventListener('MSPointerMove', pointerMove, false);
    target.addEventListener('MSPointerUp', pointerUp, false);
    target.addEventListener("MSPointerOver", pointerOver, true);
    target.addEventListener("MSPointerOut", pointerOut, true);
}

// Handle the pointer move event.
// The holding gesture is routed through this event.
// If pointer move is not handled, holding will not fire.
function pointerMove(evt) {
   _eventLog.innerText += "pointer move || ";

   // Get intermediate PointerPoints
   var pps = evt.intermediatePoints;

   // Pass the array of PointerPoints to the gesture recognizer.
   gr.processMoveEvents(pps);
};

// The pointer move event must also be handled because the 
// holding gesture is routed through this event.
// If pointer move is not handled, holding will not fire.
// A holding event is fired approximately one second after 
// a pointer down if no subsequent movement is detected.
function holdingHandler(evt) {
    if (evt.holdingState == Windows.UI.Input.HoldingState.started) {
        _eventLog.innerText += "holding || ";
    } else if (evt.holdingState == Windows.UI.Input.HoldingState.completed) {
        _eventLog.innerText += "holding completed || ";
    } else {
        _eventLog.innerText += "holding canceled || ";
    }
}

namespace GesturesApp.Manipulations
{
    /// <summary>
    /// Thin wrapper around the <see cref="Windows.UI.Input.GestureRecognizer"/>, routes pointer events received by
    /// the manipulation target to the gesture recognizer.
    /// </summary>
    /// <remarks>
    /// Transformations during manipulations cannot be expressed in the coordinate space of the manipulation target.
    /// Instead they need be expressed with respect to a reference coordinate space, usually an ancestor (in the UI tree)
    /// of the element being manipulated.
    /// </remarks>
    public abstract class InputProcessor
    {
        protected Windows.UI.Input.GestureRecognizer _gestureRecognizer;

        // Element being manipulated
        protected Windows.UI.Xaml.FrameworkElement _target;
        public Windows.UI.Xaml.FrameworkElement Target
        {
            get { return _target; }
        }

        // Reference element that contains the coordinate space used for expressing transformations 
        // during manipulation, usually the parent element of Target in the UI tree
        protected Windows.UI.Xaml.Controls.Canvas _reference;
        public Windows.UI.Xaml.FrameworkElement Reference
        {
            get { return _reference; }
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="element">
        /// Manipulation target.
        /// </param>
        /// <param name="reference">
        /// Element that contains the coordinate space used for expressing transformations
        /// during manipulations, usually the parent element of Target in the UI tree.
        /// </param>
        /// <remarks>
        /// Transformations during manipulations cannot be expressed in the coordinate space of the manipulation target.
        /// Thus <paramref name="element"/> and <paramref name="reference"/> must be different. Usually <paramref name="reference"/>
        /// will be an ancestor of <paramref name="element"/> in the UI tree.
        /// </remarks>
        internal InputProcessor(Windows.UI.Xaml.FrameworkElement element, Windows.UI.Xaml.Controls.Canvas reference)
        {
            this._target = element;
            this._reference = reference;

            // Setup pointer event handlers for the element.
            // They are used to feed the gesture recognizer.    
            this._target.PointerCanceled += OnPointerCanceled;
            this._target.PointerMoved += OnPointerMoved;
            this._target.PointerPressed += OnPointerPressed;
            this._target.PointerReleased += OnPointerReleased;
            this._target.PointerWheelChanged += OnPointerWheelChanged;

            // Create the gesture recognizer
            this._gestureRecognizer = new Windows.UI.Input.GestureRecognizer();
            this._gestureRecognizer.GestureSettings = Windows.UI.Input.GestureSettings.None;
        }

        private void OnPointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
        {
            // Route the events to the gesture recognizer.
            // All intermediate points are passed to the gesture recognizer in
            // the coordinate system of the reference element.
            this._gestureRecognizer.ProcessMoveEvents(args.GetIntermediatePoints(this._reference));

            // Mark event handled, to prevent execution of default event handlers
            args.Handled = true;
        }
    }
}

Remove the event handler and set the gesture recognizer to null if it is no longer needed:


gr.removeEventListener('MSPointerDown', pointerDown);
gr = null;
this._gestureRecognizer = null;

Constructors summary

Initializes a new instance of a GestureRecognizer object.

Properties summary

Gets or sets a value that indicates whether manipulations during inertia are generated automatically.

Gets or sets a value that indicates whether the exact distance from initial contact to end of the cross-slide interaction is reported.By default, a small distance threshold is subtracted from the first position reported by the system for cross-slide interactions. If this flag is set, the distance threshold is not subtracted from the initial position.

Note

This distance threshold is intended to account for any slight movement of the contact after initial detection. It helps the system differentiate between cross-sliding and panning, and helps ensure that a tap gesture is not interpreted as either.

Gets or sets a value that indicates whether the cross-slide axis is horizontal.

Gets or sets values that indicate the distance thresholds for a CrossSliding interaction.

Gets or sets a value that indicates the gesture and manipulation settings supported by an application.

Gets or sets a value that indicates the relative change in size of an object from the start of inertia to the end of inertia (when resizing, or scaling, is complete).

Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the resizing, or expansion, manipulation is complete).

Gets or sets a value that indicates the final angle of rotation of an object at the end of inertia (when the rotation manipulation is complete).

Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the rotation manipulation is complete).

Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the translation manipulation is complete).

Gets or sets a value that indicates the relative change in the screen location of an object from the start of inertia to the end of inertia (when the translation manipulation is complete).

Gets a value that indicates whether an interaction is being processed.

Gets a value that indicates whether a manipulation is still being processed during inertia (no input points are active).

Gets or sets a value that indicates whether the exact distance from initial contact to end of the interaction is reported.By default, a small distance threshold is subtracted from the first delta reported by the system. This distance threshold is intended to account for slight movements of the contact when processing a tap gesture. If this flag is set, the distance threshold is not subtracted from the first delta.

Gets a set of properties that are associated with the wheel button of a mouse device.

Gets or sets the center point for a rotation interaction when single pointer input is detected.

Gets or sets the radius, from the PivotCenter to the pointer input, for a rotation interaction when single pointer input is detected.

Gets or sets a value that indicates whether visual feedback is displayed during an interaction.

Methods summary

Identifies whether a tap can still be interpreted as the second tap of a double tap gesture.

Causes the gesture recognizer to finalize an interaction.

Processes pointer input and raises the GestureRecognizer events appropriate to a pointer down action for the gestures and manipulations specified by the GestureSettings property.

Performs inertia calculations and raises the various inertia events.

Processes pointer input and raises the GestureRecognizer events appropriate to a mouse wheel action for the gestures and manipulations specified by the GestureSettings property.

Processes pointer input and raises the GestureRecognizer events appropriate to a pointer move action for the gestures and manipulations specified by the GestureSettings property.

Processes pointer input and raises the GestureRecognizer events appropriate to a pointer up action for the gestures and manipulations specified by the GestureSettings property.

Events summary

Occurs when a user performs a slide or swipe gesture (through a single touch contact) within a content area that supports panning along a single axis only. The gesture must occur in a direction that is perpendicular to this panning axis.

Note

A swipe is a short sliding gesture that results in a selection action while the longer slide gesture crosses a distance threshold and results in a rearrange action. The swipe and slide gestures are demonstrated in the following diagram. Diagram showing the select and drag actions.

Occurs when a user performs a slide or swipe gesture with a mouse or pen/stylus (single contact).

Occurs when a user performs a press and hold gesture (with a single touch, mouse, or pen/stylus contact).

Occurs when the input points are lifted and all subsequent motion (translation, expansion, or rotation) through inertia has ended.

Occurs when all contact points are lifted during a manipulation and the velocity of the manipulation is significant enough to initiate inertia behavior (translation, expansion, or rotation continue after the input pointers are lifted).

Occurs when one or more input points have been initiated and subsequent motion (translation, expansion, or rotation) has begun.

Occurs after one or more input points have been initiated and subsequent motion (translation, expansion, or rotation) is under way.

Occurs when the pointer input is interpreted as a right-tap gesture, regardless of input device.

  • Right mouse button click
  • Pen barrel button click
  • Touch or pen press and hold

Occurs when the pointer input is interpreted as a tap gesture.

Constructors

Properties

  • AutoProcessInertia
    AutoProcessInertia
    AutoProcessInertia
    AutoProcessInertia

    Gets or sets a value that indicates whether manipulations during inertia are generated automatically.

    public bool AutoProcessInertia { get; set; }public bool AutoProcessInertia { get; set; }Public ReadWrite Property AutoProcessInertia As boolpublic bool AutoProcessInertia { get; set; }

    Property Value

    • bool
      bool
      bool
      bool

      True if manipulations are generated automatically; otherwise false. The default value is true.

    Remarks

    If the value for AutoProcessInertia is set to false, applications must call ProcessInertia() to handle events during inertia.

  • CrossSlideExact
    CrossSlideExact
    CrossSlideExact
    CrossSlideExact

    Gets or sets a value that indicates whether the exact distance from initial contact to end of the cross-slide interaction is reported.By default, a small distance threshold is subtracted from the first position reported by the system for cross-slide interactions. If this flag is set, the distance threshold is not subtracted from the initial position.

    Note

    This distance threshold is intended to account for any slight movement of the contact after initial detection. It helps the system differentiate between cross-sliding and panning, and helps ensure that a tap gesture is not interpreted as either.

    public bool CrossSlideExact { get; set; }public bool CrossSlideExact { get; set; }Public ReadWrite Property CrossSlideExact As boolpublic bool CrossSlideExact { get; set; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the distance threshold is not subtracted; otherwise false. The default value is false.

  • CrossSlideHorizontally
    CrossSlideHorizontally
    CrossSlideHorizontally
    CrossSlideHorizontally

    Gets or sets a value that indicates whether the cross-slide axis is horizontal.

    public bool CrossSlideHorizontally { get; set; }public bool CrossSlideHorizontally { get; set; }Public ReadWrite Property CrossSlideHorizontally As boolpublic bool CrossSlideHorizontally { get; set; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the cross-slide axis is horizontal; otherwise false. The default value is false.

  • CrossSlideThresholds
    CrossSlideThresholds
    CrossSlideThresholds
    CrossSlideThresholds

    Gets or sets values that indicate the distance thresholds for a CrossSliding interaction.

    public CrossSlideThresholds CrossSlideThresholds { get; set; }public CrossSlideThresholds CrossSlideThresholds { get; set; }Public ReadWrite Property CrossSlideThresholds As CrossSlideThresholdspublic CrossSlideThresholds CrossSlideThresholds { get; set; }

    Property Value

  • GestureSettings
    GestureSettings
    GestureSettings
    GestureSettings

    Gets or sets a value that indicates the gesture and manipulation settings supported by an application.

    public GestureSettings GestureSettings { get; set; }public GestureSettings GestureSettings { get; set; }Public ReadWrite Property GestureSettings As GestureSettingspublic GestureSettings GestureSettings { get; set; }

    Property Value

  • InertiaExpansion
    InertiaExpansion
    InertiaExpansion
    InertiaExpansion

    Gets or sets a value that indicates the relative change in size of an object from the start of inertia to the end of inertia (when resizing, or scaling, is complete).

    public float InertiaExpansion { get; set; }public float InertiaExpansion { get; set; }Public ReadWrite Property InertiaExpansion As floatpublic float InertiaExpansion { get; set; }

    Property Value

    • float
      float
      float
      float

      The relative change in size, in device-independent pixel (DIP).

  • InertiaExpansionDeceleration
    InertiaExpansionDeceleration
    InertiaExpansionDeceleration
    InertiaExpansionDeceleration

    Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the resizing, or expansion, manipulation is complete).

    public float InertiaExpansionDeceleration { get; set; }public float InertiaExpansionDeceleration { get; set; }Public ReadWrite Property InertiaExpansionDeceleration As floatpublic float InertiaExpansionDeceleration { get; set; }

    Property Value

    • float
      float
      float
      float

      The rate of deceleration, in device-independent pixel (DIP)/ms2.

    Remarks

    If InertiaExpansion is assigned a value, InertiaExpansionDeceleration is ignored.

  • InertiaRotationAngle
    InertiaRotationAngle
    InertiaRotationAngle
    InertiaRotationAngle

    Gets or sets a value that indicates the final angle of rotation of an object at the end of inertia (when the rotation manipulation is complete).

    public float InertiaRotationAngle { get; set; }public float InertiaRotationAngle { get; set; }Public ReadWrite Property InertiaRotationAngle As floatpublic float InertiaRotationAngle { get; set; }

    Property Value

    • float
      float
      float
      float

      The relative change in angle of rotation, in degrees.

  • InertiaRotationDeceleration
    InertiaRotationDeceleration
    InertiaRotationDeceleration
    InertiaRotationDeceleration

    Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the rotation manipulation is complete).

    public float InertiaRotationDeceleration { get; set; }public float InertiaRotationDeceleration { get; set; }Public ReadWrite Property InertiaRotationDeceleration As floatpublic float InertiaRotationDeceleration { get; set; }

    Property Value

    • float
      float
      float
      float

      The rate of deceleration, in degrees/ms2.

    Remarks

    If InertiaRotationAngle is assigned a value, InertiaRotationDeceleration is ignored.

  • InertiaTranslationDeceleration
    InertiaTranslationDeceleration
    InertiaTranslationDeceleration
    InertiaTranslationDeceleration

    Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the translation manipulation is complete).

    public float InertiaTranslationDeceleration { get; set; }public float InertiaTranslationDeceleration { get; set; }Public ReadWrite Property InertiaTranslationDeceleration As floatpublic float InertiaTranslationDeceleration { get; set; }

    Property Value

    • float
      float
      float
      float

      The rate of deceleration, in device-independent pixel (DIP)/ms2.

    Remarks

    If InertiaTranslationDisplacement is assigned a value, InertiaTranslationDeceleration is ignored.

  • InertiaTranslationDisplacement
    InertiaTranslationDisplacement
    InertiaTranslationDisplacement
    InertiaTranslationDisplacement

    Gets or sets a value that indicates the relative change in the screen location of an object from the start of inertia to the end of inertia (when the translation manipulation is complete).

    public float InertiaTranslationDisplacement { get; set; }public float InertiaTranslationDisplacement { get; set; }Public ReadWrite Property InertiaTranslationDisplacement As floatpublic float InertiaTranslationDisplacement { get; set; }

    Property Value

    • float
      float
      float
      float

      The relative change in screen location, in device-independent pixel (DIP).

  • IsActive
    IsActive
    IsActive
    IsActive

    Gets a value that indicates whether an interaction is being processed.

    public bool IsActive { get; }public bool IsActive { get; }Public ReadOnly Property IsActive As boolpublic bool IsActive { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the interaction (including inertia) is still being processed; otherwise false. The default value is false.

  • IsInertial
    IsInertial
    IsInertial
    IsInertial

    Gets a value that indicates whether a manipulation is still being processed during inertia (no input points are active).

    public bool IsInertial { get; }public bool IsInertial { get; }Public ReadOnly Property IsInertial As boolpublic bool IsInertial { get; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the manipulation is still being processed during inertia; otherwise false. The default value is false.

  • ManipulationExact
    ManipulationExact
    ManipulationExact
    ManipulationExact

    Gets or sets a value that indicates whether the exact distance from initial contact to end of the interaction is reported.By default, a small distance threshold is subtracted from the first delta reported by the system. This distance threshold is intended to account for slight movements of the contact when processing a tap gesture. If this flag is set, the distance threshold is not subtracted from the first delta.

    public bool ManipulationExact { get; set; }public bool ManipulationExact { get; set; }Public ReadWrite Property ManipulationExact As boolpublic bool ManipulationExact { get; set; }

    Property Value

    • bool
      bool
      bool
      bool

      True if the distance threshold is subtracted; otherwise false. The default value is false.

  • MouseWheelParameters
    MouseWheelParameters
    MouseWheelParameters
    MouseWheelParameters

    Gets a set of properties that are associated with the wheel button of a mouse device.

    public MouseWheelParameters MouseWheelParameters { get; }public MouseWheelParameters MouseWheelParameters { get; }Public ReadOnly Property MouseWheelParameters As MouseWheelParameterspublic MouseWheelParameters MouseWheelParameters { get; }

    Property Value

    Remarks

    The properties exposed through MouseWheelParameters are used in conjunction with the Wheel settings in the Mouse control panel to define the UI experience when using the wheel button.

  • PivotCenter
    PivotCenter
    PivotCenter
    PivotCenter

    Gets or sets the center point for a rotation interaction when single pointer input is detected.

    public Point PivotCenter { get; set; }public Point PivotCenter { get; set; }Public ReadWrite Property PivotCenter As Pointpublic Point PivotCenter { get; set; }

    Property Value

    • The screen location for the center of rotation, in device-independent pixel (DIP).

  • PivotRadius
    PivotRadius
    PivotRadius
    PivotRadius

    Gets or sets the radius, from the PivotCenter to the pointer input, for a rotation interaction when single pointer input is detected.

    public float PivotRadius { get; set; }public float PivotRadius { get; set; }Public ReadWrite Property PivotRadius As floatpublic float PivotRadius { get; set; }

    Property Value

    • float
      float
      float
      float

      The offset between the PivotCenter point and the single pointer input, in device-independent pixel (DIP).

  • ShowGestureFeedback
    ShowGestureFeedback
    ShowGestureFeedback
    ShowGestureFeedback

    Gets or sets a value that indicates whether visual feedback is displayed during an interaction.

    public bool ShowGestureFeedback { get; set; }public bool ShowGestureFeedback { get; set; }Public ReadWrite Property ShowGestureFeedback As boolpublic bool ShowGestureFeedback { get; set; }

    Property Value

    • bool
      bool
      bool
      bool

      True if feedback is displayed; otherwise false. The default is true.

Methods

  • CanBeDoubleTap(PointerPoint)
    CanBeDoubleTap(PointerPoint)
    CanBeDoubleTap(PointerPoint)
    CanBeDoubleTap(PointerPoint)

    Identifies whether a tap can still be interpreted as the second tap of a double tap gesture.

    public bool CanBeDoubleTap(PointerPoint value)public bool CanBeDoubleTap(PointerPoint value)Public Function CanBeDoubleTap(value As PointerPoint) As boolpublic bool CanBeDoubleTap(PointerPoint value)

    Parameters

    Returns

    • bool
      bool
      bool
      bool

      True if a UI element supports the double tap gesture and the time threshold to complete the gesture has not been crossed; otherwise false.

    Remarks

    This method supports GestureRecognizer object pool management, where GestureRecognizer objects are dynamically assigned to a set of UI elements.

    Specifically, GestureRecognizer objects can be recycled for UI elements that do not support or can no longer process a double tap gesture. For example, if CanBeDoubleTap(PointerPoint) returns true for the most recent PointerPoint, it’s not safe to recycle the GestureRecognizer because a double tap is still a viable interaction based on subsequent input. If CanBeDoubleTap(PointerPoint) returns false, the GestureRecognizer can be safely recycled.

    This method is not required if GestureRecognizer object pool management is not implemented.

  • CompleteGesture()
    CompleteGesture()
    CompleteGesture()
    CompleteGesture()

    Causes the gesture recognizer to finalize an interaction.

    public void CompleteGesture()public void CompleteGesture()Public Function CompleteGesture() As voidpublic void CompleteGesture()

    Remarks

    This method sets IsActive and IsInertial to false, based on the current state of the interaction. Depending on the interaction one of the following events is raised:

  • ProcessDownEvent(PointerPoint)
    ProcessDownEvent(PointerPoint)
    ProcessDownEvent(PointerPoint)
    ProcessDownEvent(PointerPoint)

    Processes pointer input and raises the GestureRecognizer events appropriate to a pointer down action for the gestures and manipulations specified by the GestureSettings property.

    public void ProcessDownEvent(PointerPoint value)public void ProcessDownEvent(PointerPoint value)Public Function ProcessDownEvent(value As PointerPoint) As voidpublic void ProcessDownEvent(PointerPoint value)

    Parameters

  • ProcessInertia()
    ProcessInertia()
    ProcessInertia()
    ProcessInertia()

    Performs inertia calculations and raises the various inertia events.

    public void ProcessInertia()public void ProcessInertia()Public Function ProcessInertia() As voidpublic void ProcessInertia()
  • ProcessMouseWheelEvent(PointerPoint, Boolean, Boolean)
    ProcessMouseWheelEvent(PointerPoint, Boolean, Boolean)
    ProcessMouseWheelEvent(PointerPoint, Boolean, Boolean)
    ProcessMouseWheelEvent(PointerPoint, Boolean, Boolean)

    Processes pointer input and raises the GestureRecognizer events appropriate to a mouse wheel action for the gestures and manipulations specified by the GestureSettings property.

    public void ProcessMouseWheelEvent(PointerPoint value, Boolean isShiftKeyDown, Boolean isControlKeyDown)public void ProcessMouseWheelEvent(PointerPoint value, Boolean isShiftKeyDown, Boolean isControlKeyDown)Public Function ProcessMouseWheelEvent(value As PointerPoint, isShiftKeyDown As Boolean, isControlKeyDown As Boolean) As voidpublic void ProcessMouseWheelEvent(PointerPoint value, Boolean isShiftKeyDown, Boolean isControlKeyDown)

    Parameters

    • value

      The input point.

    • isShiftKeyDown
      System.Boolean
      System.Boolean
      System.Boolean
      System.Boolean

      True if the Shift key is pressed; otherwise false.

    • isControlKeyDown
      System.Boolean
      System.Boolean
      System.Boolean
      System.Boolean

      True if the Ctrl key is pressed.

  • ProcessMoveEvents(IVector<PointerPoint>)
    ProcessMoveEvents(IVector<PointerPoint>)
    ProcessMoveEvents(IVector<PointerPoint>)
    ProcessMoveEvents(IVector<PointerPoint>)

    Processes pointer input and raises the GestureRecognizer events appropriate to a pointer move action for the gestures and manipulations specified by the GestureSettings property.

    public void ProcessMoveEvents(IVector<PointerPoint> value)public void ProcessMoveEvents(IVector<PointerPoint> value)Public Function ProcessMoveEvents(value As IVector<PointerPoint>) As voidpublic void ProcessMoveEvents(IVector<PointerPoint> value)

    Parameters

    • value

      The pointer location history based on the PointerId . If no history is available then the value is the current location of the input pointer.

  • ProcessUpEvent(PointerPoint)
    ProcessUpEvent(PointerPoint)
    ProcessUpEvent(PointerPoint)
    ProcessUpEvent(PointerPoint)

    Processes pointer input and raises the GestureRecognizer events appropriate to a pointer up action for the gestures and manipulations specified by the GestureSettings property.

    public void ProcessUpEvent(PointerPoint value)public void ProcessUpEvent(PointerPoint value)Public Function ProcessUpEvent(value As PointerPoint) As voidpublic void ProcessUpEvent(PointerPoint value)

    Parameters

Events

  • CrossSliding
    CrossSliding
    CrossSliding
    CrossSliding

    Occurs when a user performs a slide or swipe gesture (through a single touch contact) within a content area that supports panning along a single axis only. The gesture must occur in a direction that is perpendicular to this panning axis.

    Note

    A swipe is a short sliding gesture that results in a selection action while the longer slide gesture crosses a distance threshold and results in a rearrange action. The swipe and slide gestures are demonstrated in the following diagram. Diagram showing the select and drag actions.

    public event TypedEventHandler CrossSlidingpublic event TypedEventHandler CrossSlidingPublic Event CrossSlidingpublic event TypedEventHandler CrossSliding

    Remarks

    GestureSettings must be set in the GestureSettings property to support CrossSliding.

    CrossSliding distance thresholds are disabled by default. Use CrossSlideThresholds to set these values.

  • Dragging
    Dragging
    Dragging
    Dragging

    Occurs when a user performs a slide or swipe gesture with a mouse or pen/stylus (single contact).

    public event TypedEventHandler Draggingpublic event TypedEventHandler DraggingPublic Event Draggingpublic event TypedEventHandler Dragging

    Remarks

    GestureSettings must be set in the GestureSettings property to support Dragging.

  • Holding
    Holding
    Holding
    Holding

    Occurs when a user performs a press and hold gesture (with a single touch, mouse, or pen/stylus contact).

    public event TypedEventHandler Holdingpublic event TypedEventHandler HoldingPublic Event Holdingpublic event TypedEventHandler Holding

    Remarks

    To support Holding with touch and pen/stylus input, specify GestureSettings in the GestureSettings property.

    To support Holding with mouse input, specify GestureSettings in the GestureSettings property.

    The Holding event is fired twice: Once when holding starts (HoldingState ) and again when holding ends (HoldingState or HoldingState ).

  • ManipulationCompleted
    ManipulationCompleted
    ManipulationCompleted
    ManipulationCompleted

    Occurs when the input points are lifted and all subsequent motion (translation, expansion, or rotation) through inertia has ended.

    public event TypedEventHandler ManipulationCompletedpublic event TypedEventHandler ManipulationCompletedPublic Event ManipulationCompletedpublic event TypedEventHandler ManipulationCompleted
  • ManipulationInertiaStarting
    ManipulationInertiaStarting
    ManipulationInertiaStarting
    ManipulationInertiaStarting

    Occurs when all contact points are lifted during a manipulation and the velocity of the manipulation is significant enough to initiate inertia behavior (translation, expansion, or rotation continue after the input pointers are lifted).

    public event TypedEventHandler ManipulationInertiaStartingpublic event TypedEventHandler ManipulationInertiaStartingPublic Event ManipulationInertiaStartingpublic event TypedEventHandler ManipulationInertiaStarting

    Remarks

    Inertia is the tendency of an object to resist any change in its state of rest or its velocity.

    This event is raised before inertia processing.

    Inertia behavior for this manipulation can be customized in the handler for this event. For example, inertia can be set to end after a specific distance or UI is displayed.

    Note

    These settings cannot be customized after the event.

  • ManipulationStarted
    ManipulationStarted
    ManipulationStarted
    ManipulationStarted

    Occurs when one or more input points have been initiated and subsequent motion (translation, expansion, or rotation) has begun.

    public event TypedEventHandler ManipulationStartedpublic event TypedEventHandler ManipulationStartedPublic Event ManipulationStartedpublic event TypedEventHandler ManipulationStarted
  • ManipulationUpdated
    ManipulationUpdated
    ManipulationUpdated
    ManipulationUpdated

    Occurs after one or more input points have been initiated and subsequent motion (translation, expansion, or rotation) is under way.

    public event TypedEventHandler ManipulationUpdatedpublic event TypedEventHandler ManipulationUpdatedPublic Event ManipulationUpdatedpublic event TypedEventHandler ManipulationUpdated
  • RightTapped
    RightTapped
    RightTapped
    RightTapped

    Occurs when the pointer input is interpreted as a right-tap gesture, regardless of input device.

    • Right mouse button click
    • Pen barrel button click
    • Touch or pen press and hold
    public event TypedEventHandler RightTappedpublic event TypedEventHandler RightTappedPublic Event RightTappedpublic event TypedEventHandler RightTapped

    Remarks

    Listen for this event when you want to display a context menu.

  • Tapped
    Tapped
    Tapped
    Tapped

    Occurs when the pointer input is interpreted as a tap gesture.

    public event TypedEventHandler Tappedpublic event TypedEventHandler TappedPublic Event Tappedpublic event TypedEventHandler Tapped

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.UI.Input.dll