Shortcut

Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.

Up and coming

Bind a key chord such as Ctrl+Enter, Ctrl+Shift+F or F5 to an action, scoped to where the keyboard is.

Under a Window a Shortcut works anywhere in it; under a UIObject, only while keyboard focus is inside it. A chord without Ctrl or Alt never fires while you type in a TextBox, unless AllowInTextBox is set. A MenuItem whose Shortcut is this one shows its keys and is activated by them, so a menu entry and its keys are one route.

Made with Instance.new("Shortcut") or Clone().

Properties

NameTypeDefaultDescription
KeysstringThe chord as text, such as "Ctrl+Enter", "Ctrl+Shift+F", "F5" or "Escape".
Enabledboolean
AllowInTextBoxbooleanFalse by default for a chord without Ctrl or Alt, so a letter or Space typed into a box never fires it.

Events

NamePassesDescription
Activated()Fires on the keys: anywhere in its Window, or under a UIObject only while keyboard focus is inside it.
From ShotInstance 33