# BarShortcut class

Namespace: [Grasshopper2.UI.Toolbar](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.toolbar.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class BarShortcut
```

Maintains fields for key shortcuts to bar elements.

## Constructors

- [BarShortcut](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/ctor.md): (2 overloads)

## Properties

- [Char](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/char.md): Gets or sets what key char might trigger this element. It is up to the control or form hosting this toolbar element to decide whether or not to actually use this information. If a [BarShortcut.Keys](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/keys.md) has been set, the [BarShortcut.Char](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/char.md) property will be set to the null char.
- [Info](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/info.md): Gets or sets the explanatory info for the [BarShortcut.Keys](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/keys.md) or [BarShortcut.Char](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/char.md) fields. This may be drawn as a suffix in a tooltip.
- [Keys](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/keys.md): Gets or sets what key(s) might trigger this element. It is up to the control or form hosting this toolbar element to decide whether or not to actually use this information. If a [BarShortcut.Char](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/char.md) has been set, the [BarShortcut.Keys](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/keys.md) property will be set to `Keys.None`.

## Methods

- [Matches](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/matches.md): Check whether key event arguments matches this code.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.barshortcut/tostring.md)
