Mouse Input

The Xbox One Mouse API is designed for exclusive apps that need precision control. You’ll feel right at home if you are familiar with the Universal Windows Platform (UWP) CoreWindow mouse/cursor API, although the Xbox version is slightly different.

This topic contains the following sections:

Overview

The Xbox One Mouse API provides data about raw mouse movement and position, horizontal and vertical wheel motion, and cursor screen position. It supports up to five mouse buttons and allows you to use custom cursor glyphs. All standard USB mice are supported.

Differences between the Xbox One Mouse API and UWP

The Xbox One Mouse API is contained mostly in the Windows.Input.Devices namespace. Although the Xbox API follows the UWP API as closely as possible, the following UWP features are not available in the Xbox One Mouse API:

Game Mode

The Xbox One Mouse API has a functionality called Game Mode, which is similar to Game Mode for UWP. Game Mode locks the pointer to a specific position if you subscribe to the MouseDevice.MouseMoved and MouseDevice.MouseWheelMoved events and hide the cursor by setting the CoreWindow.PointerPosition property to null. This mainly impacts the following scenarios:

Cross-VM calls

The following are cross-VM calls and should be treated as such:

Custom cursors

Setting a custom cursor is a particularly expensive cross-VM call and should not be done too frequently. This means that you can’t animate a cursor by setting a new custom cursor every frame.

The following additional programming guidelines apply to custom cursors:

Input core1 utilization

Mouse input is partially processed on SRA core1 (ERA core6) to help maintain performance in high-load scenarios. If you are using mouse input, you can keep latency low by minimizing the load on core6.

Platform limitations

The following platform limitations apply to the Xbox One Mouse API:

In this section

How to: Determine Whether a Mouse is Connected
Explains how to programmatically determine whether a mouse device is currently connected to an Xbox One console.

How to: Show or Hide the Mouse Cursor
Explains how to show or hide the mouse cursor on Xbox One.

How to: Process Mouse Input Events
Explains how to process input events from a mouse device.

How to: Poll for Mouse Input
Explains how to poll for input from a mouse device.

See also

Input Overview

Input Technologies and Devices Overviews

Keyboard

Keyboard Overview

Reference

MouseDevice Class