# ItemSelectionEventTriggers

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/primitives/struct-itemselectioneventtriggers/

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

```rust
struct ItemSelectionEventTriggers
```

Defines standard logic for selecting items via user input. Behaviour
differs between input devices.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/item_selection_event_triggers.rs#L13)

## Members

- [`should_trigger_selection`](#function-should_trigger_selection)
- [`should_trigger_selection_key`](#function-should_trigger_selection_key)
- [`has_range_selection_modifier`](#function-has_range_selection_modifier)
- [`has_toggle_selection_modifier`](#function-has_toggle_selection_modifier)

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

### should_trigger_selection

```rust
fn should_trigger_selection(selectable: &Visual, event_args: &PointerEventArgs) -> bool
```

Analyses an input event received by a selectable element, and
determines whether the action should trigger selection on press, on
release, or not at all.

`selectable` is the selectable element which is processing the
event.

This method expects to analyse pointer pressed and pointer released
events.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/item_selection_event_triggers.rs#L25)

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

### should_trigger_selection_key

```rust
fn should_trigger_selection_key(selectable: &Visual, event_args: &KeyEventArgs) -> bool
```

Analyses an input event received by a selectable element, and
determines whether the action should trigger selection.

This method expects to analyse key down events.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/item_selection_event_triggers.rs#L81)

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

### has_range_selection_modifier

```rust
fn has_range_selection_modifier(selectable: &Visual, event_args: &dyn IRoutedEventArgs) -> bool
```

Whether `event_args` should trigger range selection.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/item_selection_event_triggers.rs#L92)

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

### has_toggle_selection_modifier

```rust
fn has_toggle_selection_modifier(selectable: &Visual, event_args: &dyn IRoutedEventArgs) -> bool
```

Whether `event_args` should trigger toggle selection.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/item_selection_event_triggers.rs#L97)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`

## Availability

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