Поделиться через


Responding to Pen Flicks

Responding to Pen Flicks

Pen flicks are quick, linear pen movements associated with scrolling actions and commands. Pen flicks allow quick pen access to navigation and editing actions. Windows Vista includes a set of eight basic pen flicks.

The following illustration shows a diagram of the eight pen flick directions and their default actions.

Gesture map

Windows Vista enables the navigational pen flicks (up, down, left, and right) by default. The user can set an option to enable the editing pen flicks.

Pen flicks are intended to provide the user with a set of gestures that work throughout the system. Applications can fully support pen flicks by responding to a flicks notification and processing any supported actions. Applications that do not process the pen flick notifications will receive follow-up notifications: keystrokes, scrolling notifications, or application command notifications, depending on which commands are assigned in Control Panel.

Pen flicks are not processed in applications that are actively accepting ink. Applications can also disable pen flicks if necessary.

Windows Vista includes a tutorial for pen flicks that offers options, practice exercises, and explanations. The tutorial is offered the first time the system detects that the user has performed a pen flick. Although encouraged to learn about and use pen flicks, users can disable their use through the Control Panel.

Pen Flick Actions

In Control Panel, the user can assign commands to pen flicks. Four types of actions with pen flicks include:

  • Scroll up or down
  • An application command such as Back or Undo (Windows Vista supports the set of application commands listed below in Processing Application Commands.
  • Any keystroke or keystroke combination
  • Activating a modifier key such as SHIFT

The following illustrations show the use of a Drag Up pen flick in Microsoft Internet Explorer.

Dd356077.99729478-fe7c-49f7-bb70-a65676fa3e7f(en-us,VS.85).jpg

As an option in Control Panel, the user can assign modifier keys such as SHIFT to pen flicks. Modifier keys are treated differently from other keystrokes. With most keystrokes, the key codes are sent to the application when the user performs the pen flick. If a modifier key is assigned, when the user performs the pen flick, the key label is displayed with the pen cursor until the next pen action, at which point the modifier key is sent with the pen tap. This capability enables the user to incorporate modifier keys with pen flicks and pen taps.

How Pen Flicks Work

When the user performs a pen flick, Windows Vista issues the request to the targeted application and displays a fading label or graphic at the end of the stroke. If the pen flick sends a scrolling command, the command is sent to the application over which the pen flick occurred, whether or not that application is active. Otherwise, the command is sent to the active application.

In most cases, when the user performs a pen flick to edit, the application applies the command to the selection. This is the expected behavior, though it is possible to change this default behavior. For example, you could use the starting position of the pen flick to determine the focus of the command.

Responding Consistently with User Expectations

Applications should respond to pen flicks in a manner consistent with the command the user has assigned in Control Panel. When the user performs a pen flick, Windows Vista displays the visual feedback associated with the assigned command, regardless of how the application responds to the pen flick. For example, if the user has mapped a left pen flick to Undo but your application overrides that and performs a Back command, the fading icon shown to the user will still be the Undo icon.

This apparent inconsistency is a design decision meant to encourage application designers to honor the user's mapped commands, ensuring a consistent experience throughout the system. Applications do have the ability to react to the flick in a way other than that specified by the user. However, the intention is that the application performs the expected behavior in all cases.

For example, the user might map the Up pen flick to Scroll Up. In your application, it might make more sense to interpret the Up pen flick as Page Up. However, there is a risk associated with this approach since the user can customize all pen flicks and may set the Up pen flick to perform an unexpected action such as Delete.

How Applications are Notified of Pen Flicks

Windows Vista uses a staged approach to inform an application that a pen flick has been performed over it:

  1. Windows Vista first notifies an application by sending a WM_TABLET_FLICK Message. The FLICK_DATA Structure and FLICK_POINT Structure accompanying the notification provides full information about the pen flick, including:

    • The screen coordinates where the flick started
    • The requested action for the pen flick
    • The direction of the pen flick
    • The state of modifier keys such as Ctrl and Shift
  2. Ideally, an application will respond to the WM_TABLET_FLICK Message. If the application does not respond, Windows Vista sends follow-up notifications (WM_APPCOMMAND, WM_VSCROLL, or WM_KEYDOWN, depending on which action is associated with the pen flick). In this way, an application that does not process the WM_TABLET_FLICK Message can still offer some response to the pen flick.

The strategy is aimed at providing a consistent pen flicks experience even in applications that were not designed to process the pen flick notifications.

Processing Application Commands

Your application should respond to any of the application commands that could be potentially assigned to a pen flick. If an application fails to respond to the WM_TABLET_FLICK Message , Windows Vista follows up by sending the applicable WM_APPCOMMAND notification, followed then by a WM_KEYDOWN notification.

Following is a list of application commands that can be assigned to pen flicks, with the backup keystroke message that might be sent.

Command Backup keystroke

APPCOMMAND_BROWSER_BACKWARD

None

APPCOMMAND_BROWSER_FORWARD

None

APPCOMMAND_COPY

Ctrl+C

APPCOMMAND_PASTE

Ctrl+V

APPCOMMAND_UNDO

Ctrl+Z

APPCOMMAND_DELETE

Del

APPCOMMAND_CUT

Ctrl+X

APPCOMMAND_OPEN

Ctrl+O

APPCOMMAND_PRINT

Ctrl+P

APPCOMMAND_SAVE

Ctrl+S

APPCOMMAND_REDO

Ctrl+Y

Editing commands such as Copy, Paste, Cut, and Delete are generally performed on the selection. If there is no selection, you can use the data in the FLICK_POINT Structure to determine what object may be the target of the editing command.

Processing Scrolling Commands

By default, the Scroll Up and Scroll Down commands are assigned to the upward and downward pen flicks. Scrolling commands are sent to the window over which the pen flick occurred, whether or not that window is active. All other pen flick commands are sent to the active window.

Best practices include:

  • Implement smooth scrolling visuals in response to scrolling pen flicks. Internet Explorer provides a good example of smooth scrolling in response to pen flicks.
  • Provide a scrolling distance equivalent to a PAGE UP and PAGE DOWN keystroke. Ensure your application scrolls immediately upon processing a scrolling pen flick, and enable the user to scroll repeatedly using pen flicks. For example, if the user flicks twice downward and then once upward while the scrolling is in progress, the net scrolling distance should correspond to one pen flick.
  • Scroll to the targeted location as smoothly as possible, avoiding jumping or flashing.

Disabling Pen Flicks

If necessary, you can disable pen flicks in your application. For more information, see Flicks Gestures.

Send comments about this topic to Microsoft

Build date: 12/5/2008