导出 (0) 打印
全部展开
信息
您所需的主题如下所示。但此主题未包含在此库中。

GestureRecognizer Class

提供笔势和操作标识、事件侦听器和设置。

语法


Public NotInheritable Class GestureRecognizer

特性

[MarshalingBehavior(None)]
[Version(0x06020000)]

成员

GestureRecognizer类 具有这些类型的成员:

构造函数

GestureRecognizer类 具有这些构造函数。

构造函数说明
GestureRecognizer Initializes a new instance of a GestureRecognizer object.

 

事件

GestureRecognizer类 具有这些事件。

事件说明
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.
Dragging Occurs when a user performs a slide or swipe gesture with a mouse or pen/stylus (single contact).
Holding Occurs when a user performs a press and hold gesture (with a single touch, mouse, or pen/stylus contact).
ManipulationCompleted Occurs when the input points are lifted and all subsequent motion (translation, expansion, or rotation) through inertia has ended.
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).
ManipulationStarted Occurs when one or more input points have been initiated and subsequent motion (translation, expansion, or rotation) has begun.
ManipulationUpdated Occurs after one or more input points have been initiated and subsequent motion (translation, expansion, or rotation) is under way.
RightTapped Occurs when the pointer input is interpreted as a right-tap gesture.
Tapped Occurs when the pointer input is interpreted as a tap gesture.

 

方法

The GestureRecognizer 类 具有这些方法。 对于 C#、Visual Basic 和 C++,它还继承方法于Object 类.

方法说明
CanBeDoubleTap Identifies whether a tap can still be interpreted as the second tap of a double tap gesture.
CompleteGesture Causes the gesture recognizer to finalize an interaction.
ProcessDownEvent Processes pointer input and raises the GestureRecognizer events appropriate to a pointer down action for the gestures and manipulations specified by the GestureSettings property.
ProcessInertia Performs inertia calculations and raises the various inertia events.
ProcessMouseWheelEvent Processes pointer input and raises the GestureRecognizer events appropriate to a mouse wheel action for the gestures and manipulations specified by the GestureSettings property.
ProcessMoveEvents Processes pointer input and raises the GestureRecognizer events appropriate to a pointer move action for the gestures and manipulations specified by the GestureSettings property.
ProcessUpEvent Processes pointer input and raises the GestureRecognizer events appropriate to a pointer up action for the gestures and manipulations specified by the GestureSettings property.

 

属性

GestureRecognizer类 具有这些属性。

属性访问类型说明

AutoProcessInertia

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

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.

CrossSlideHorizontally

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

CrossSlideThresholds

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

GestureSettings

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

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).

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).

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).

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).

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).

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).

IsActive

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

IsInertial

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

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.

MouseWheelParameters

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

PivotCenter

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

PivotRadius

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

ShowGestureFeedback

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

 

Windows Phone 8

此 API 不实现,但是调用时会引发异常。请参见 Windows Phone 运行时 API

备注

注意  :此类不敏捷,这意味着您需要考虑其线程模型和封送行为。有关更多信息,请参见线程处理和封送处理 (C++/CX)在多线程环境中使用 Windows 运行时对象 (.NET)

示例

在此,我们用一组输入事件处理程序来设置 GestureRecognizer 对象,用以处理各种指针和笔势。

有关如何侦听和处理 Windows 运行时事件的更多信息,请参见以 JavaScript 使用 Windows 运行时

注意  使用 targetcurrentTarget 属性(属于事件处理程序中的事件对象而非 GestureRecognizer 对象)。

目前没有可用的代码示例或不支持该语言。

移除事件处理程序并将不再需要的特定动作识别器设置为 null:

目前没有可用的代码示例或不支持该语言。

要求

最低支持客户端

Windows 8 [仅 Windows 应用商店应用程序]

最低支持服务器

Windows Server 2012 [仅 Windows 应用商店应用程序]

最低支持电话

Windows Phone 8 [未实现,请参见备注]

命名空间

Windows.UI.Input
Windows::UI::Input [C++]

元数据

Windows.winmd

另请参见

引用
Windows.UI.Input 类
Windows.Devices.Input
Windows.UI.Core
Windows.UI.Input
Windows.UI.Input.Inking
Windows.UI.Xaml.Input
概念
响应用户交互
常见用户交互准则
开发 Windows 应用商店应用(JavaScript 和 HTML)
使用在 JavaScript 上的 Windows 运行时
触控交互模型
示例 (DOM)
HTML 滚动、平移和缩放示例
输入:DOM 指针事件处理示例
输入:可实例化笔势示例
示例(Windows 应用商店应用  API)
输入:设备功能示例
输入:墨迹示例
输入:操作和笔势 (JavaScript) 示例
输入:简化墨迹示例
输入:Windows 8 笔势示例
输入:XAML 用户输入事件示例
XAML 滚动、平移和缩放示例
示例 (DirectX)
DirectX 触控输入示例
输入:操作和笔势 (C++) 示例
输入:触控命中测试示例
示例(Win32/桌面)
输入源标识示例
触摸注入示例
Win32 触控命中测试示例

 

 

显示:
© 2014 Microsoft