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


Supporting Hardware Buttons

Supporting Hardware Buttons

This topic discusses how applications can enable users to take full advantage of the hardware buttons provided on Tablet PCs. Hardware buttons provide an important input method for Tablet PC users who are operating without a keyboard. By providing application support for the common functions assigned to hardware buttons, you can enable your users to interact with your application more naturally and efficiently.

Microsoft requires that Tablet PC OEMs include a login button that performs the Secure Attention Sequence (SAS) action for displaying the Windows Vista login screen. This button is also a logo requirement. There are a variety of other buttons that Tablet PC manufacturers can include in their hardware design.

With Windows Vista, the user can customize the functions of the hardware buttons to perform scrolling actions, run commands such as Navigate Backward, and use keystrokes such as ENTER and ESC.

How to support hardware buttons

Supporting the use of hardware buttons is simple and involves the same programming methods used for other types of command input. Applications can support two types of button actions:

Action type Examples Recommendation

Keystrokes

ENTER, ESC, UP ARROW, DOWN ARROW

Provide keyboard support for all tasks

Application commands

Navigate Backward, Increase/Decrease Volume, Cut/Copy/Paste

Monitor the WM_APPCOMMAND notification and process application commands that pertain to your functionality and usage scenarios.

The WM_APPCOMMAND notifies a window that the user generated an application command event by clicking a Tablet PC hardware button, by performing a flick gesture, by pressing a function key on a keyboard, or by other means. By responding to application commands passed through this notification, you can increase the ways in which the user can access your application functions.

Review the set of commands documented with the WM_APPCOMMAND notification and for each, consider how it might map to the commands and functions supported within your application. For example, the Back button is associated with Web browsers and other information viewers where returning to a previous page is important. The Back button may also be used to dismiss a dialog box, menu, or property sheet.

Consider incorporating keyboard support throughout your application. Keyboard support for scrolling is particularly important within mobile usage scenarios.

Button configurations on Tablet PCs

Microsoft encourages OEMs to include hardware buttons in addition to the required login button. Various button configurations are possible, depending on how manufacturers decide to implement their design. The following shows a basic and extended recommendation.

Recommendation Button List

Basic

  • Up
  • Down
  • Enter
  • Rotate display

Extended

  • A five-way up/down/left/right/Enter pad
  • ESC
  • Rotate display
  • Mobility center
  • Wireless on/off
  • Volume/mute

Hardware buttons behave like keyboard keys. The user can press and immediately release a button, press and hold a button, or press two or more buttons simultaneously. The user can assign actions to a button press and release, and assign a separate action when the button is held down. When the user holds a button down, one of two things can happen:

  • If a press-and-hold action is assigned, Windows Vista will perform that action.
  • If no press-and-hold action is assigned, Windows Vista will repeat the assigned action for press and release, similarly to how a keyboard key repeats when held down. Not all actions are repeatable; see the table in the following section to see which ones repeat when a hardware button is held down.

The login button is limited to performing the SAS task. Other buttons can be assigned default actions by OEMs. The user can override these assignments by customizing the buttons to perform scrolling actions, application commands, and other tasks.

Send comments about this topic to Microsoft

Build date: 12/5/2008