# MouseStateHistory class

Namespace: [Grasshopper2.UI.Flex](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.flex.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public class MouseStateHistory
```

Maintains a collection of sorted mouse states. This class is not threadsafe, only modify it from the UI thread.

## Properties

- [ContentSpaceDistance](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/contentspacedistance.md): Gets the distance from the oldest to the youngest state in content space. If there are no states, a distance of zero is returned.
- [ContentSpaceMaxDistance](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/contentspacemaxdistance.md): Gets the furthest distance from the oldest state in content space. If there are no states, a distance of zero is returned.
- [ControlSpaceDistance](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/controlspacedistance.md): Gets the distance from the oldest to the youngest state in control space. If there are no states, a distance of zero is returned.
- [ControlSpaceMaxDistance](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/controlspacemaxdistance.md): Gets the furthest distance from the oldest state in control space. If there are no states, a distance of zero is returned.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/count.md): Gets the number of states stored.
- [First](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/first.md): Gets the oldest state in this history, if it exists.
- [Last](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/last.md): Gets the newest state in this history, if it exists.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/item.md): Gets the state at the given index.

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/add.md): Add a new state to this history.
- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/clear.md): (3 overloads) Remove all states from this history.
- [FindIndexAfter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/findindexafter.md): Gets the index of the oldest state after a specific time.
- [FindIndexBefore](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.mousestatehistory/findindexbefore.md): Gets the index of the youngest state before a specific time.
