Gesture

Description

Occurs when an application gesture recognized by the control is completed. A gesture is a stroke or series of strokes that is recognized by the application as indicating an action. This event can only be triggered on a Tablet PC.

Event ID

Event ID

Objects

pbm_inkegesture

InkEdit

pbm_inkpgesture

InkPicture


Arguments

Argument

Description

gest

Integer identifying the gesture recognized. See the tables in the Usage section for argument values.


Return Values

Boolean.

Return false to accept the gesture and true to ignore it.

Usage

The Gesture event is triggered only on a Tablet PC. On a Tablet PC, the InkEdit control recognizes the following gestures that represent keystrokes that are frequently used in edit controls. To ensure that the gestures are recognized, users should draw straight lines and sharp right angles without removing the stylus from the control. InkEdit controls on other computers behave as MultiLineEdit controls and cannot accept ink input from a mouse.

Gesture

Gesture name

Argument value

Keystroke

Left

0

Backspace

Right

1

Space

UpRightLong

2

Tab

DownLeftLong

3

Enter

UpRight

4

Tab

DownLeft

5

Enter


On a Tablet PC, the InkPicture control recognizes the following gestures that are equivalent to mouse clicks:

Gesture name

Argument value

Mouse action

Tap

1

Left Click

Double Tap

2

Left Double Click


When you tap the stylus or click a mouse in an InkPicture control on a Tablet PC, the Gesture event is triggered. On other computers, a mouse click triggers the Stroke event. The CollectionMode property must be set to GestureOnly! for a double tap to be recognized. Only single-stroke gestures are recognized when CollectionMode is set to InkAndGesture!. If a gesture is not recognized, the value of the argument is 0.

Examples

This code in the Gesture event of an InkEdit control confirms to the user that the gesture was recognized:

CHOOSE CASE gest
   CASE 0
      MessageBox("Gesture recognized",  &
         "You entered a space")
   CASE 1
      MessageBox("Gesture recognized",  &
         "You entered a backspace")
 
   CASE 2,4
      MessageBox("Gesture recognized",  &
         "You entered a tab")
   CASE 3,5
      MessageBox("Gesture recognized",  &
         "You entered a return")
END CHOOSE

return false

See also

RecognitionResult

Stroke