# KeyGestureFormatInfo

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

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

```rust
struct KeyGestureFormatInfo
```

Provides platform specific formatting information for the `KeyGesture`
class.

A format info without platform key overrides is the invariant one: keys
are formatted with their plain names.

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

## Members

- [`new`](#function-new)
- [`invariant`](#function-invariant)
- [`meta`](#function-meta)
- [`ctrl`](#function-ctrl)
- [`alt`](#function-alt)
- [`shift`](#function-shift)
- [`get_instance`](#function-get_instance)
- [`format_key`](#function-format_key)

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

### new

```rust
fn new(platform_key_overrides: Option<HashMap<Key, String>>, meta: &str, ctrl: &str, alt: &str, shift: &str) -> Self
```

Creates a format info.

`platform_key_overrides` holds the platform specific key names;
`meta`, `ctrl`, `alt` and `shift` are the names of the modifier
keys.

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

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

### invariant

```rust
fn invariant() -> Rc<KeyGestureFormatInfo>
```

The invariant format info, used as formatting fallback.

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

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

### meta

```rust
fn meta(self: &Self) -> &str
```

The string used to represent Meta on the platform.

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

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

### ctrl

```rust
fn ctrl(self: &Self) -> &str
```

The string used to represent Ctrl on the platform.

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

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

### alt

```rust
fn alt(self: &Self) -> &str
```

The string used to represent Alt on the platform.

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

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

### shift

```rust
fn shift(self: &Self) -> &str
```

The string used to represent Shift on the platform.

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

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

### get_instance

```rust
fn get_instance(format_provider: Option<Rc<KeyGestureFormatInfo>>) -> Rc<KeyGestureFormatInfo>
```

Returns `format_provider` if given, otherwise the format info
registered with the locator, otherwise the invariant one.

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

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

### format_key

```rust
fn format_key(self: &Self, key: Key) -> String
```

Checks the platform overrides and the common overrides, in that
order, and returns the name of the key in the appropriate style, or
the key's plain name if there is none.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`

## Availability

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