> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInputReading::GetMouseState

> IGameInputReading::GetMouseState

# IGameInputReading::GetMouseState

Retrieve a view of the input reading that describes the state of a mouse.

## Syntax

```cpp theme={null}
bool GetMouseState(
    GameInputMouseState* state
);
```

### Parameters

*state*   \_Out\_\
Type: [GameInputMouseState\*](/reference/input/gameinput/structs/gameinputmousestate)

Interpretation of the input as a mouse.

### Return value

Type: bool

Returns true on successful interpretation of a mouse input. Returns false when attempting to read an input that is not recognized as a mouse input.

## Remarks

Call the [IGameInputReading::GetInputKind](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getinputkind) method to see which Get\*State functions will return a valid interpretation for some [IGameInputReading](/reference/input/gameinput/interfaces/igameinputreading/igameinputreading). Each Get\*State function has a corresponding entry in the [IGameInputReading::GetInputKind](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getinputkind) enum. If you attempt to call a Get\*State function where the corresponding [IGameInputReading::GetInputKind](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getinputkind) flag is not set, the function will return with default at rest values as well as a false return value.

Mouse movement is reported natively from the device as relative delta values and/or absolute values, depending on device capabilities. Relative positions are not very compatible with a polling API, because periodically asking for the current mouse reading is likely to miss several intermediate deltas. Rather than forcing apps that use the polling APIs to walk through potentially dozens of historical mouse readings and adding up the deltas, the GameInput API exposes relative mouse movement by continuously accumulating deltas into a virtual "position" value. Applications then compute their own deltas by subtracting the "position" value from the previous reading they obtained. This allows access to individual deltas when calculated for consecutive readings, or accumulated deltas when intermediate readings have been intentionally skipped. It should be stressed that the mouse "position" value is merely the sum of all movement deltas, and does not correlate with screen-space coordinates in any way.

## Requirements

**Header:** GameInput.h

[Input API Overview](/build/core-features/common/input/overviews/input-overview)\
[IGameInputReading](/reference/input/gameinput/interfaces/igameinputreading/igameinputreading)

## Version History

| Version | Changes     |
| ------- | ----------- |
| **v0**  | Introduced. |


## Related topics

- [GameInputMouseState](/reference/input/gameinput/structs/gameinputmousestate.md)
- [IGameInputReading::GetGamepadState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getgamepadstate.md)
- [IGameInputReading::GetSensorsState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getsensorsstate.md)
- [IGameInputReading::GetKeyState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getkeystate.md)
- [IGameInputReading::GetTouchState](/reference/input/gameinput/deprecated/interfaces/igameinputreading/methods/igameinputreading_gettouchstate.md)
