We describe how the new Windows UI in Windows 8 supports user interactions through mouse devices. Learn how to take full advantage of these mouse capabilities in your Windows Store apps.
This documentation is relevant for developers building Windows Store apps for tablets and computers that have a mouse device connected.
Touch is a fundamental aspect of the Windows 8 experience. Touch interactions use physical gestures to emulate the direct manipulation of UI elements and provide a real-world experience when interacting with those objects on the screen. Mouse interactions are best suited to applications that require precision pointing and clicking.
To support mouse interactions in scenarios that emphasize direct manipulation (such as swiping, sliding, dragging, rotating, and so on), Windows Store apps use the mouse hover event to expose mouse-specific UI. This mouse-specific UI enables you to provide equivalent functionality for the users of your app independent of the device they are using. For example, when a mouse is detected emulate panning content through a scrollbar or flipping through pages of content with previous and next buttons.
User experience guidelines for supporting mouse interactions
Here are some guidelines for supporting mouse interactions.
The Windows 8 mouse language
Windows 8 provides a concise set of mouse interactions that are used consistently throughout the system. Applying this mouse language consistently makes your app feel familiar for your users. This increases user confidence and makes your app easier to learn and use.
| Term | Description |
|---|---|
|
Hover to learn |
Hover over an element to display more detailed info or teaching visuals (such as a tooltip) without a commitment to an action. For more info on tooltips, see Adding tooltips. |
|
Left-click for primary action |
Left-click an element to invoke its primary action (such as launching an app or executing a command). |
|
Scroll to change view |
Display scroll bars to move up, down, left, and right within a content area. Users can scroll by clicking scroll bars, right-click and drag, or rotating the mouse wheel. Scroll bars can indicate the location of the current view within the content area (panning with touch displays a similar UI). |
|
Right-click to select and command |
Right-click to display the app bar with global commands. Right-click an element to select it and display the app bar with contextual commands for the selected element. Note Right-click to display a context menu if selection or app bar commands are not appropriate UI behaviors. But we strongly recommend that you use the app bar for all command behaviors. |
|
UI commands to zoom |
Display UI commands in the app bar (such as + and -), or press Ctrl and rotate mouse wheel, to emulate pinch and stretch gestures for zooming. |
|
UI commands to rotate |
Display UI commands in the app bar (such as + and -), or press Ctrl+Shift and rotate mouse wheel, to emulate the turn gesture for rotating. Rotate the device itself to rotate the entire screen. |
|
Left-click and drag to rearrange |
Left-click and drag an element to move it. |
|
Left-click and drag to select text |
Left-click within selectable text and drag to select it. Double-click to select a word. |
|
Mouse corners and edges for system commands |
Move mouse to top-right or bottom-right corner on left-to-right (LTR) layouts and top-left or bottom-left corner on right-to-left (RTL) layouts to display a preview of the charms. Move mouse within the preview to activate the charms. Move mouse to top-left corner on left-to-right (LTR) layouts and top-right corner on right-to-left (RTL) layouts to display thumbnail of the most recently used app. Left-click or click-and-drag to cycle through and switch to running apps or drag to snap the app (if supported by screen resolution). Move mouse to the bottom-left corner on left-to-right (LTR) layouts and bottom-right corner on right-to-left (RTL) layouts to display thumbnail of the Start screen. Left-click and drag from the top edge toward the bottom edge of the screen to close the current app. Left-click and drag from the top edge down and to the left or right edge to snap the current app to that side of the screen. |
Hardware
Query the mouse device capabilities to identify what aspects of your app UI the mouse hardware can access directly. For more info on querying device capabilities, see Quickstart: Identifying pointer devices.
Some mouse devices have 5 buttons. The fourth and fifth buttons, referred to as X buttons, typically navigate back and forward in Web browsers such as Windows Internet Explorer. Associate these buttons with appropriate UI (back and forward buttons) in your app.
If a mouse has a wheel button, make rotating forward and backward activate vertical (up and down) scrolling within the content area. Activate horizontal (left and right) scrolling if the content area doesn't scroll vertically. If the wheel button is a tilt wheel, it should activate only horizontal scrolling.
The scroll wheel should activate zooming (if exposed) when the user presses the Ctrl modifier key.
Visual feedback
- When a mouse is detected (through move or hover events), show mouse-specific UI. If the mouse doesn't move for a certain amount of time, or if the user initiates a touch interaction, make the mouse UI gradually fade away. This keeps the UI clean and uncluttered.
- Provide visual feedback (or hover effects) for UI elements to indicate interactivity during mouse over events. Don't use the cursor for hover feedback, the feedback provided by the element is sufficient (see Cursors below).
- Don't display visual feedback if an element doesn't support interaction (such as static text).
- Don't use focus rectangles with mouse interactions. Reserve these for keyboard interactions.
- Display visual feedback concurrently for all elements that represent the same input target.
- Provide buttons (such as + and -) for emulating touch-based manipulations such as panning, rotating, zooming, and so on.
For more general guidance on visual feedback, see Guidelines for visual feedback.
Cursors
A set of standard cursors is available to use for a mouse pointer in Windows Store apps.
Each standard cursor has a corresponding default image associated with it. The user or an app can replace the default image associated with any standard cursor at any time. Windows Store apps specify a cursor image through the PointerCursor function.
If you need to customize the mouse cursor:
- Always use the arrow cursor (
) for clickable elements. Don't use the pointing hand cursor (
) for links or other interactive elements. Instead, use hover effects (described earlier). - Use the text cursor (
) for selectable text. - Use the move cursor (
) when moving is the primary action (such as dragging or cropping). Don't use the move cursor for elements where the primary action is navigation (such as Start tiles). - Use the horizontal, vertical and diagonal resize cursors (
,
,
,
), when an object is resizable. - Use the grasping hand cursors (
,
) when panning content within a fixed canvas (such as a map).
Commanding
Clicking the right mouse button should activate the app's app bar. Avoid dead zones in the UI of your app that don't accept right-clicks. For more info on app bars, see Adding app bars.
Related topics
- Conceptual
- Responding to user interaction
- Developing mouse controls (DirectX and C++)
- Samples (Windows Store app APIs)
- Input: Device capabilities sample
- Input: XAML user input events sample
- Reference
- Windows.Devices.Input
- Windows.UI.Core
- Windows.UI.Input
Build date: 11/29/2012