# KeyEventArgs

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

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

```rust
struct KeyEventArgs
```

Provides information specific to a keyboard event.

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

## Members

- [`key`](#struct_field-key)
- [`key_modifiers`](#struct_field-key_modifiers)
- [`physical_key`](#struct_field-physical_key)
- [`key_symbol`](#struct_field-key_symbol)
- [`key_device_type`](#struct_field-key_device_type)
- [`new`](#function-new)

<a id="struct_field-key"></a>

### key

```rust
key: super::Key
```

The virtual-key for the associated event.

A given physical key can result in different virtual keys depending
on the current keyboard layout. This is the key that is generally
referred to when creating keyboard shortcuts. For example, when
pressing the key located at the `Z` position on standard US English
QWERTY keyboard, this property returns:

- `Key::Z` for an English (QWERTY) layout
- `Key::W` for a French (AZERTY) layout
- `Key::Y` for a German (QWERTZ) layout
- `Key::Z` for a Russian (JCUKEN) layout

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

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

### key_modifiers

```rust
key_modifiers: super::KeyModifiers
```

The key modifiers for the associated event.

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

<a id="struct_field-physical_key"></a>

### physical_key

```rust
physical_key: super::PhysicalKey
```

The physical key for the associated event.

This value is independent of the current keyboard layout and usually
corresponds to the key printed on a standard US English QWERTY
keyboard. This is the key to use for position-dependent bindings
such as WASD movement in games.

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

<a id="struct_field-key_symbol"></a>

### key_symbol

```rust
key_symbol: Option<String>
```

The unicode symbol of the key, or `None` if none is applicable.

For example, when pressing the key located at the `Z` position on
standard US English QWERTY keyboard, this property returns:

- `z` for an English (QWERTY) layout
- `w` for a French (AZERTY) layout
- `y` for a German (QWERTZ) layout
- `я` for a Russian (JCUKEN) layout

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

<a id="struct_field-key_device_type"></a>

### key_device_type

```rust
key_device_type: super::KeyDeviceType
```

The type of key device that sent this event.

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

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

### new

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

Creates args with default values and no routed event.

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

## 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`
- `Default`
- `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/).
