# GestureRecognizer

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

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

```rust
struct GestureRecognizer
```

The base class of gesture recognizers.

A recognizer is attached to an input element through the element's
gesture recognizer collection and receives the pointer events of that
element. A recognizer that detects its gesture captures the pointer,
after which pointer input goes to the recognizer only.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`pointer_pressed`](#function-pointer_pressed)
- [`pointer_released`](#function-pointer_released)
- [`pointer_moved`](#function-pointer_moved)
- [`pointer_capture_lost`](#function-pointer_capture_lost)
- [`construct`](#function-construct)
- [`target`](#function-target)
- [`capture`](#function-capture)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<GestureRecognizer>
```

Returns a strong reference to this object.

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

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

### pointer_pressed

```rust
fn pointer_pressed(self: &Self, e: &PointerPressedEventArgs)
```

Called when a pointer is pressed on the target.

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

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

### pointer_released

```rust
fn pointer_released(self: &Self, e: &PointerReleasedEventArgs)
```

Called when a pointer is released on the target.

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

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

### pointer_moved

```rust
fn pointer_moved(self: &Self, e: &PointerEventArgs)
```

Called when a pointer moves over the target.

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

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

### pointer_capture_lost

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

Called when the capture of a pointer is lost.

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

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `crate::FerroObject::construct`.

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

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

### target

```rust
fn target(self: &Self) -> Option<Ref<InputElement>>
```

The element the recognizer is attached to.

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

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

### capture

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

Captures a pointer to the recognizer: further input of the pointer
goes to the recognizer and other recognizers are skipped.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`GestureRecognizerImplExt`](/docs/0.5.0/api/ferroui-base/input/gesture_recognizers/trait-gesturerecognizerimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<GestureRecognizer>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`GestureRecognizerImpl`](/docs/0.5.0/api/ferroui-base/input/gesture_recognizers/trait-gesturerecognizerimpl/)

## Availability

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