Windows Touch Gestures Overview

This section describes the various gestures supported by Windows Touch.

Gestures Overview

Windows Touch enables several gestures that support single and multiple contacts.     The following image illustrates the various gestures that are supported in Windows 7.

Illustration showing the gestures that Windows Touch supports in Windows 7

Note  Some recognizers are more reliable at interpreting gestures with multiple contacts       when the contacts are further apart from each other.

Legacy Support

For legacy support, the default gesture handler maps some gestures to Windows messages that were used in previous versions of Windows. The following table outlines how gestures map to legacy messages.

GestureDescriptionMessage(s) Generated
PanThe pan gesture maps to using the scroll wheel.

WM_VSCROLL

WM_HSCROLL

Press and HoldThe press and hold gesture  maps to right clicking the mouse.

WM_RBUTTONDOWN

WM_RBUTTONUP

ZoomThe zoom gesture triggers messages that are similar to holding the CTRL key, and spinning the mouse wheel to scroll.WM_MOUSEWHEEL with MK_CONTROL set in the lParam

Interpreting Windows Touch Gestures

Windows Touch gestures can be interpreted by application developers by handling the WM_GESTURE message from the WndProc function of an application.  After handling this message, you can retrieve a GESTUREINFO structure which describes the gesture.  The GESTUREINFO structure will have assorted information that depends on the type of gesture.  

   The GESTUREINFO structure is retrieved by passing the handle to the gesture information structure to the GetGestureInfo function.

   The following flags indicate the various states of the gestures and are stored in dwFlags.   

NameValueDescription
GF_BEGIN0x00000001A gesture is starting.
GF_INERTIA0x00000002A gesture has triggered inertia.
GF_END0x00000004A gesture has finished.

Note    Most applications should ignore the GID_BEGIN and GID_END and pass them to DefWindowProc.    These messages are used by the default gesture handler. Application behavior is undefined when  the GID_BEGIN and GID_END messages are consumed by a third-party application.

  The following table indicates the various identifiers for gestures. 

NameValueDescription
GID_BEGIN1A gesture is starting.
GID_END2A gesture is ending.
GID_ZOOM3The zoom gesture.
GID_PAN4The pan gesture.
GID_ROTATE5The rotation gesture.
GID_TWOFINGERTAP6The two-finger tap gesture.
GID_PRESSANDTAP7The press and tap gesture.

Note      The GID_PAN gesture has built-in inertia.  At the end of a pan gesture, additional pan    gesture messages are created by the operating system.   

  The GESTUREINFO structure members  ptsLocation and ullArguments specify a point (using the POINTS structure) and additional information about gestures depending on the gesture.  The following table lists the values associated with each type of gesture.

Gesture IDullArgumentsptsLocation
GID_ZOOMIndicates the distance between the two points.Indicates the center of the zoom.
GID_PANIndicates the distance between the two points.Indicates the current position of the pan.
GID_ROTATEIndicates the angle of rotation if If the GF_BEGIN flag is set. Otherwise, this is the angle change since the rotation has started.  This is signed to indicate the direction of the rotation.  Use the GID_ROTATE_ANGLE_FROM_ARGUMENT and GID_ROTATE_ANGLE_TO_ARGUMENT macros to get and set the angle value.This indicates the center of the rotation which is the stationary point that the target object is rotated around.
GID_TWOFINGERTAPIndicates the distance between the two fingers.Indicates the center of the two fingers.
GID_PRESSANDTAPIndicates the delta between the first finger and the second finger. This value is stored in a POINT structure in the lower 32 bits of the ullArguments member.Indicates the position that the first finger comes down on.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值