# PointerEventArgs

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/input/struct-pointereventargs/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct PointerEventArgs
```

Provides data for pointer events.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L20)

## Members

- [`new`](#function-new)
- [`with_previous_points`](#function-with_previous_points)
- [`with_platform_input_event_cookie`](#function-with_platform_input_event_cookie)
- [`pointer`](#function-pointer)
- [`timestamp`](#function-timestamp)
- [`platform_input_event_cookie`](#function-platform_input_event_cookie)
- [`key_modifiers`](#function-key_modifiers)
- [`get_position`](#function-get_position)
- [`get_current_point`](#function-get_current_point)
- [`get_intermediate_points`](#function-get_intermediate_points)
- [`prevent_gesture_recognition`](#function-prevent_gesture_recognition)
- [`properties`](#function-properties)

<a id="function-new"></a>

### new

```rust
fn new<T: ?Sized>(routed_event: Option<&RoutedEvent<T>>, source: impl Into<Nullable<FerroObject>>, pointer: Rc<dyn IPointer>, root_visual: Option<&Visual>, root_visual_position: Point, timestamp: u64, properties: PointerPointProperties, modifiers: KeyModifiers) -> Self
```

Creates pointer event args.

`root_visual` is the root of the tree that observed the event and
`root_visual_position` the position of the pointer in its
coordinates. `timestamp` is the platform time stamp of the input.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L42)

<a id="function-with_previous_points"></a>

### with_previous_points

```rust
fn with_previous_points(self: Self, previous_points: Option<IntermediatePoints>) -> Self
```

Adds the intermediate points of the event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L70)

<a id="function-with_platform_input_event_cookie"></a>

### with_platform_input_event_cookie

```rust
fn with_platform_input_event_cookie(self: Self, cookie: Option<Rc<dyn Any>>) -> Self
```

Adds the platform's cookie for the input event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L76)

<a id="function-pointer"></a>

### pointer

```rust
fn pointer(self: &Self) -> &Rc<dyn IPointer>
```

The pointer that caused the event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L83)

<a id="function-timestamp"></a>

### timestamp

```rust
fn timestamp(self: &Self) -> u64
```

The time when the pointer event occurred, as reported by the
platform.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L90)

<a id="function-platform_input_event_cookie"></a>

### platform_input_event_cookie

```rust
fn platform_input_event_cookie(self: &Self) -> Option<&Rc<dyn Any>>
```

The platform's opaque cookie for the input event that caused this
event, if any.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L97)

<a id="function-key_modifiers"></a>

### key_modifiers

```rust
fn key_modifiers(self: &Self) -> KeyModifiers
```

The key modifiers held down when the event occurred.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L108)

<a id="function-get_position"></a>

### get_position

```rust
fn get_position(self: &Self, relative_to: Option<&Visual>) -> Point
```

Gets the pointer position relative to a control, or relative to the
root of the tree that observed the event when `relative_to` is
`None`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L134)

<a id="function-get_current_point"></a>

### get_current_point

```rust
fn get_current_point(self: &Self, relative_to: Option<&Visual>) -> PointerPoint
```

Returns the pointer point associated with the current event,
positioned relative to a control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L140)

<a id="function-get_intermediate_points"></a>

### get_intermediate_points

```rust
fn get_intermediate_points(self: &Self, relative_to: Option<&Visual>) -> Vec<PointerPoint>
```

Returns all points since the last relevant pointer event, positioned
relative to a control. The last one is the current point.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L146)

<a id="function-prevent_gesture_recognition"></a>

### prevent_gesture_recognition

```rust
fn prevent_gesture_recognition(self: &Self)
```

Prevents this event from being handled by other gesture recognizers
in the route.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L172)

<a id="function-properties"></a>

### properties

```rust
fn properties(self: &Self) -> PointerPointProperties
```

The state of the pointer device at the time of the event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/pointer_event_args.rs#L180)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Deref`
- [`IRoutedEventArgs`](/docs/0.5.0/api/ferroui-base/interactivity/trait-iroutedeventargs/)
- [`IKeyModifiersEventArgs`](/docs/0.5.0/api/ferroui-base/input/trait-ikeymodifierseventargs/)
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
