windows:Interaction/touch

出自UXGuide.net

跳转到:导航, 搜索

触摸
Touch

所有 Microsoft® Windows® 应用程序都应当具有极好的触摸体验。这么做其实比你想像的要容易。

目录


“触摸”指 Windows 允许你使用手指直接与计算机进行交互的方式。与使用鼠标、键盘或手写笔相比,触摸更加方便、自然、具有吸引力。

Cc872774_Touch05(en-us,MSDN_10).png


使用触摸

许多触摸交互都通过手势(gesture)和划动(flick)来完成的。手势是指手指在屏幕上的快速移动,计算机会将其解释为命令而非鼠标移动、书写或绘图。Windows 7 has new multitouch gestures such as pan, zoom, rotate, two-finger tap, and press and tap. 其中最快速容易的手势就是划动。“划动”是一个简单的手势,用于执行导航或编辑命令。导航划动手势包括向上拖动、向下拖动、向后翻而和向前翻页,编辑划动手势包括复制、粘贴、撤销和删除。

“操纵(manipulation)”是指实时、真实应用于对象上的操作。操纵与手势不同,其输入直接关系到对象状态的改变。例如,一个照片查看程序会让用户通过移动、缩放、调整尺寸及旋转的方式操纵图像。“多点触摸操纵”则同时使用多个接触点。

对于需要精准移动或悬停的任务,Windows Vista® 提供了“触摸指示器”,一个看起来像鼠标的浮动屏幕指示器。因为触摸指示器并不易于用作直接输入,因此可触摸程序应当避免对触摸指示器的依赖。The touch pointer is disabled by default in Windows 7.

当一个程序 has only the touch support provided by Windows and the controls for the most important tasks are easy to touch,即可称为“可触摸(touchable)”程序。(那些需要使用指甲的任务不能认为是触摸友好的——可触摸控件应当大到足够轻易地使用指尖定位。)在实践中,这意味着:

当一个程序已经对其主要任务为触摸进行了优化时,可称之为“有效触摸(touch-enabled)”的程序。这通常是指:

当一个程序针对触摸进行了特别优化时,则可称为“为触摸优化(touch-optimized)”的程序。这通常是指:

注:鼠标手写笔无障碍访问(辅助特性)相关的设计规范请参考各自相应的章节。


Design concepts

Using touch for input has the following characteristics:

Touch provides a natural, real-world feel to interaction. Direct manipulation and animation complete this impression, by giving objects a realistic, dynamic motion and feedback. For example, consider a card game. Not only is it convenient and easy to drag cards using a finger, the experience takes on an engaging real-world feel when you can toss the cards and have them glide, spin, and bounce exactly like physical cards. And when you try to move a card that can't be moved, it's a better experience to have the card resist but not prevent movement, and settle back in place when released, to clearly indicate that the action was recognized but can't be done.


All Windows programs should be touchable

While touch is traditionally associated with Tablet PCs, it is becoming common on ordinary computers. The Windows Tablet and Touch Technology is a standard component of Windows Vista and Windows 7, so any compatible computer has the ability to take advantage of touch if it has the appropriate hardware. As a result, computer manufacturers are now including touchscreens in ordinary laptops and even in desktop monitors.

As touch spreads from Tablet PCs to other types of computers, software program developers and designers will find it increasingly important to support touch as well. All Windows programs should have a great touch experience. Users should be able to perform your program's most important tasks efficiently using their fingers. Some tasks, like typing or detailed pixel manipulation, may not be appropriate for touch, but those that are should be touchable.

Fortunately, if your program is already well designed, providing a great touch experience is easy to do. For this purpose, a well-designed program:

Unfortunately, the converse is also true—if your program isn't well designed, its shortcomings are going to be especially obvious to users who use touch.

Just as accessible software benefits all users, providing a great touch experience benefits all users because everyone benefits when basic interactions are easy to perform, efficient, responsive, and forgiving.


Model for touch interaction

If you aren't experienced with using touch, the best introduction is to learn by doing. Get a touch-enabled computer, put the mouse and keyboard aside, and do the tasks that you normally do using just your fingers. If you have a Tablet PC, experiment with holding it in different positions, such as on your lap, lying flat on a table, or in your arms while you're standing. Try using it in portrait and landscape orientation.

As you experiment with touch, you'll discover that:

While there are several challenges here, addressing them improves the experience for all users.


Basic touch design principles

Each input device has its strengths and weaknesses. The keyboard is best for text input and giving commands with minimal hand movement. The mouse is best for efficient, precise pointing. Touch is best for object manipulation and giving simple commands. A pen is best for freeform expression, as with handwriting and drawing.

When thinking about touch support for your program:


Control sizes

Fitts' Law states that the time required to interact with a target depends upon the size of the target and the distance to it. The smaller a target is, and the further away it is, the harder it is to use. But due to the large surface area of the fingertip, small controls that are too close together can also be difficult to target precisely.

As a general rule, a control size of 23x23 pixels (13x13 DLUs) is a good minimum interactive control size for any input device. By contrast, the spin controls at 15x11 pixels are much too small to be used effectively with touch.

Cc872774_Touch07(en-us,MSDN_10).png


The spin control is too small for touch.

Note that the minimum size is really based on physical area, not layout metrics such as pixels or DLUs. Research indicates that the minimum target area for efficient, accurate interaction using a finger is 6x6 millimeters (mm). This area translates to layout metrics as follows:

Font Millimeters Relative pixels DLUs
9 point Segoe UI 6x6 23x23 13x13
8 point Tahoma 6x6 23x23 15x14

Furthermore, research shows that a minimum size of 10x10 mm (about 40x40 pixels) enables better speed and accuracy, and also feels more comfortable to users. When practical, use this larger size for command buttons used for the most important or frequently used commands.

Cc872774_Touch09(en-us,MSDN_10).png


In this example, Microsoft Word uses buttons larger than 10x10 mm for the most important commands.

Cc872774_Touch10a(en-us,MSDN_10).png


This version of Calculator uses buttons larger than 10x10 mm for its most frequently used commands.

The goal isn't to have giant controls—just easily touchable controls. You can make controls easily touchable without appearing excessively large by using the techniques listed in the guidelines section later in this article.

Note: When sizing controls, target 96 dpi. Users' ability to touch improves with higher resolutions.


Control spacing

The spacing between controls is also a factor in making controls easily touchable. Targeting is quicker but less precise when using a finger as the pointing device, resulting in users more often tapping outside their intended target. When interactive controls are placed very close together but are not actually touching, users may click on inactive space between the controls. Because clicking inactive space has no result or visual feedback, users are often uncertain what went wrong. If small controls are too closely spaced, the user needs to tap with precision to avoid tapping the wrong object. To address these issues, the target regions of interactive controls should either be touching or preferably have at least 5 pixels (3 DLUs) of space between them.

You can make controls within groups easier to differentiate by using more than the recommended vertical spacing between controls. For example, radio buttons at 19 pixels high are shorter than the minimum recommended size of 23 pixels. When you have vertical space available, you can achieve roughly the same effect as the recommended sizing by adding an additional 4 pixels of spacing to the standard 7 pixels.

Correct:

Cc872774_Touch11(en-us,MSDN_10).png


Better:

Cc872774_Touch12(en-us,MSDN_10).png


In the better example, the extra spacing between the radio buttons makes them easier to differentiate.

There may be situations in which extra spacing would be desirable when using touch, but not when using the mouse or keyboard. In such cases, you should only use a more spacious design when an action is initiated using touch.


Control location

Task locality reduces tedious repeating cross-screen movements. To minimize hand movements, locate controls close to where they are most likely going to be used.

Incorrect:

Cc872774_Touch15(en-us,MSDN_10).png


In this example from Windows XP, the color palette is too far from where it is likely to be used.

Consider that the user's current location is the closest a target can be, making it trivial to acquire. Thus, context menus take full advantage of Fitts' law, as do the mini-toolbars and smart tags used by Microsoft Office.

Cc872774_Touch16(en-us,MSDN_10).png


The current pointer location is always the easiest to acquire.

Small targets near the display edge can be difficult to touch, so avoid placing small controls near window edges. To ensure that controls are easy to target when a window is maximized, either make them at least 23x23 pixels (13x13 DLUs) or place them away from the window edge.


Touch interactions

System gestures

System gestures are defined and handled by Windows. As a result, all Windows programs have access to them. These gestures have equivalent mouse, keyboard, and application command messages:

System gesture Synthesized equivalent message
Hover (when supported) Mouse hover
Tap (down and up) Mouse left-click
Double tap (down and up twice) Mouse double left-click
Press and hold (down, pause, up) Mouse right-click
Drag (down, move, up) Mouse left-drag
Press, hold, and drag (down, pause, move, up) Mouse right-drag
Select (down, move over selectable objects, up) Mouse select

Developers: For more information, see SystemGesture Enumeration.


Flicks

Flicks are simple gestures that are roughly the equivalent of keyboard shortcuts. Navigational flicks include drag up, drag down, move back, and move forward. Editing flicks include copy, paste, undo, and delete. To use flicks, your program only needs to respond to the related keystrokes commands—or your program can handle the events directly.

Cc872774_Touch13a(en-us,MSDN_10).png


The eight flick gestures and their default assignments in Windows 7. The navigation flicks were changed to correspond to panning (where the object moves with the gesture) instead of scrolling (where the object moves in the opposite direction of the gesture).

Cc872774_Touch13(en-us,MSDN_10).png


The eight flick gestures and their default assignments in Windows Vista.

The navigational flicks have natural mapping, so they are easy to learn and remember. The editing flicks are diagonals that require more precision and their mappings are not as natural (flick towards the Recycle Bin to delete, flick in the Back arrow direction to undo), so these aren't enabled by default. All flick actions can be customized using the Pen and Input Devices control panel item.

Flick Synthesized equivalent message
Flick left Forward command (Back command for Windows Vista)
Flick right Back command (Forward command for Windows Vista)
Flick up Keyboard Scroll Down
Flick down Keyboard Scroll Up
Flick up-left diagonal Keyboard Delete
Flick down-left diagonal Keyboard Undo
Flick up-right diagonal Keyboard Copy
Flick down-right diagonal Keyboard Paste


Application gestures

Applications can define and handle other gestures as well. The Microsoft Gesture Recognizer can recognize over 40 gestures. To use application gestures, your program must define the gestures it recognizes, and then handle the resulting events.


Hover

Hover is a useful interaction because it allows users to get additional information through tips before initiating an action. Doing so makes users feel more confident and reduces errors.

Unfortunately, hover isn't supported by touch technologies, so users will not be able to hover when using a finger. The simple solution to this problem is to take full advantage of hover, but only in ways that are not required to perform an action. In practice, this usually means that the action can also be performed by clicking, but not necessarily in exactly the same way.

Cc872774_Touch14(en-us,MSDN_10).png


In this example, users can see today's date by either hovering or clicking.


Responsiveness and consistency

Responsiveness is essential for creating touch experiences that feel direct and engaging. To feel direct, gestures must take effect immediately, and an object's contact points must stay under the user's fingers smoothly throughout the gesture. The effect of a manipulation should map directly to the user's motion, so, for example, if the user rotates his fingers 90 degrees, the object should rotate 90 degrees as well. Any lag, choppy response, loss of contact, or inaccurate results destroys the perception of direct manipulation and also of quality.

Consistency is essential for creating touch experiences that feel natural and intuitive. Once users learn a standard gesture, they expect that gesture to have the same effect across all applicable programs. To avoid confusion and frustration, never assign non-standard meanings to standard gestures. Instead, use custom gestures for interactions unique to your program.


Forgiveness

What makes touch so natural, expressive, efficient, and engaging is its directness. In fact, interacting through touch is often referred to as direct manipulation. However, where there is direct manipulation, there can be accidental manipulation—and therefore the need for forgiveness.

Forgiveness is the ability to reverse or correct an undesired action easily. You make a touch experience forgiving by providing undo, giving good visual feedback, having a clear physical separation between frequently used commands and destructive commands, and allowing users to correct mistakes easily. Associated with forgiveness is preventing undesired actions from happening in the first place, which you can do by using constrained controls and confirmations for risky actions or commands that have unintended consequences.


Editing text

Editing text is one of the most challenging interactions when using a finger. Using constrained controls, appropriate default values, and auto-completion eliminates or reduces the need to input text. But if your program involves editing text, you can make users more productive by automatically zooming input UI up to 150 percent by default when touch is used.

For example, an e-mail program could display UI at normal touchable size, but zoom the input UI to 150 percent to compose messages.

Cc872774_Touch17(en-us,MSDN_10).png


In this example, the input UI is zoomed to 150 percent.

If you do only six things...

  1. Make your Windows programs have a great touch experience! Users should be able to perform your program's most important tasks efficiently using a finger (at least the tasks that don't involve a lot of typing or detailed pixel manipulation).
  2. For common controls, use the standard control sizing. For other controls, make sure they have at least a 23x23 pixel (13x13 DLU) click target, even if their static appearance is much smaller.
  3. Make use of hover, but don't make it the only way to perform an action. Hover isn't supported by most touchscreen technologies.
  4. To create a direct and engaging experience, have gestures take effect immediately, keep contact points under the user's fingers smoothly throughout the gesture, and have the effect of the gesture map directly to the user's motion.
  5. To create a natural and intuitive experience, support appropriate standard gestures and assign them their standard meanings. Use custom gestures for interactions unique to your program.
  6. Make sure your program provides the ability to reverse or correct any undesired actions—especially for destructive commands. Accidental actions are more likely when using touch.


Guidelines

Control usage


Control sizing

Cc872774_Touch20(en-us,MSDN_10).png
The recommended control sizes are easily touchable.
Cc872774_Touch21(en-us,MSDN_10).png
Whenever practical, use larger command buttons for important or frequently used commands.
Correct:
Cc872774_Touch22a(en-us,MSDN_10).png
Cc872774_Touch22b(en-us,MSDN_10).png
Incorrect:
Cc872774_Touch23(en-us,MSDN_10).png
Correct:
Cc872774_Touch24(en-us,MSDN_10).png
In the correct examples, the click targets are larger than the statically visible UI elements.
For example, the progressive disclosure triangles used by the tree view control are only 6x9 pixels, but their functionality is redundant with their associated item labels.
Cc872774_Touch28(en-us,MSDN_10).png
The tree view triangles are too small to be easily touchable, but they are redundant in functionality with their larger associated labels.
Cc872774_Touch29(en-us,MSDN_10).png
In this example, the system metric for menu height was changed.


Control layout and spacing

Cc872774_Touch30(en-us,MSDN_10).png
In this example, Windows 7 taskbar Jump Lists are more spacious when displayed using touch.


Interaction

Developers: For more information about integrating the touch keyboard, see ITextInputPanelInterface.


Windows Touch gestures

Use the following gestures whenever applicable to your program. These gestures are the most useful and natural.

Entry state: One or two fingers in contact with the screen.
Motion: Drag, with any additional fingers remaining in same position relative to each other.
Exit state: Last finger up ends the gesture.
Effect: Move the underlying object directly and immediately as the fingers move. Be sure to keep the contact point under the finger throughout the gesture.
Cc872774_Touch34(en-us,MSDN_10).png
The pan gesture.
Entry state: Two fingers in contact with the screen at the same time.
Motion: Fingers move apart or together (pinch) along an axis.
Exit state: Any finger up ends the gesture or the fingers break the axis.
Effect: Zoom the underlying object in or out directly and immediately as the fingers separate or approach on the axis. Be sure to keep the contact points under the finger throughout the gesture.
Cc872774_Touch35(en-us,MSDN_10).png
The zoom gesture.
If animated carefully, allowing users to zoom while panning can be a powerful, efficient interaction.
Entry state: Two fingers in contact with the screen at the same time.
Motion: One or both fingers rotate around the other, moving perpendicular to the line between them.
Exit state: Any finger up ends the gesture.
Effect: Rotate the underlying object the same amount as the fingers have rotated. Be sure to keep the contact points under the finger throughout the gesture.
Cc872774_Touch36(en-us,MSDN_10).png
The rotation gesture.
Rotation makes sense only for certain types of objects, so it's not mapped to a system Windows interaction.
Rotation is often done differently by different people. Some people prefer to rotate one finger around a pivot finger, while others prefer to rotate both fingers in a circular motion. Most people use a combination of the two, with one finger moving more than the other. While smooth rotation to any angle is the best interaction, in many contexts, such as photo viewing, it is best to settle to the nearest 90 degree rotation once the user lets go. In photo editing, a small rotation can be used to straighten the photo.
Entry state: Two fingers in contact with the screen at the same time.
Motion: No motion.
Exit state: Any finger up ends the gesture.
Effect: Alternatively zooms or restores the default view for the object between the fingers.
Cc872774_Touch37(en-us,MSDN_10).png
The two-finger tap gesture.
Entry state: One finger in contact with the screen, followed by a second finger.
Motion: No motion.
Exit state: Second finger up ends the gesture.
Effect: Performs a right click for the object under the first finger.
Cc872774_Touch38(en-us,MSDN_10).png
The press and tap gesture.


Forgiveness

Cc872774_Touch33(en-us,MSDN_10).png
Routine confirmations are acceptable for interactions that users often do accidentally using touch.
Developers: You can distinguish between mouse events and touch events using the GetMessageExtraInfo API.

Documentation

When referring to touch:

导航
工具箱