次の方法で共有


Gesture Event [InkEdit Control]

Gesture Event [InkEdit Control]

Occurs when an application gesture is recognized.

Declaration

[C++]

HRESULT Gesture(
    [in] IInkCursor* Cursor,
    [in] IInkStrokes* Strokes,
    [in] VARIANT Gestures,
    [in, out] VARIANT_BOOL* Cancel
);

Parameters

Cursor

[in] The IInkCursor object that was used to create this gesture.

Strokes

[in] The InkStrokes collection that contains the IInkStrokeDisp objects that make up this gesture.

Gestures

[in] An array of IInkGesture objects, in order of confidence.

For more information about the VARIANT structure, see Using the Automation Library.

Cancel

[in, out] Whether the InkStrokes collection that makes up this gesture should be canceled, so as not to erase the ink and to fire the Stroke event.

Remarks

This event method is defined in the _IInkEditEvents interface. The _IInkEditEvents interface implements the IDispatch Leave Site interface with an identifier of DISPID_IeeGesture.

A Gesture event is raised only if the IInkStrokeDisp for the IInkGesture object is the first IInkStrokeDisp object since the last call to the InkEdit::Recognize() method or the last firing of the recognition timeout.

If the Gesture event is cancelled, the Stroke event is raised for the InkStrokes collection that raised the Gesture event.

For this event to occur, the InkEdit control must subscribe to a set of application gestures. To set the InkEdit control's interest in a set of gestures, call the InkEdit::SetGestureStatus method.

For a list of application gestures, see the InkApplicationGesture enumeration type. For more information about application gestures, see Making Windows Work with a Pen.

The InkEdit control does not recognize multiple stroke gestures.

The InkEdit control subscribes to the following gestures.

Gesture Action
Down-left,Down-left-long Enter
Right Space
Left Backspace
Up-right,Up-right-long Tab

To alter the default action for a gesture

  1. Add event handlers for the Gesture and Stroke events.
  2. In the Gesture event handler, cancel the Gesture event for the gesture, and perform the alternate action for the gesture.
  3. In the Stroke event handler, cancel the Stroke event for the IInkStrokeDisp object that raised the cancelled Gesture event.

Applies To