Shortcut

data class Shortcut(val key: String, val modifiers: Set<KeyModifier>)(source)

A keyboard shortcut: key is the name of a key, like k, f5 or escape, held with modifiers. Written as mod+shift+k, where mod is command on macOS and control elsewhere, cmd, ctrl, alt and shift the others.

Constructors

Link copied to clipboard
constructor(key: String, modifiers: Set<KeyModifier>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val key: String
Link copied to clipboard
val modifiers: Set<KeyModifier>

Functions

Link copied to clipboard
fun matches(event: KeyEvent): Boolean

true when event is the shortcut

Link copied to clipboard
open override fun toString(): String

the shortcut as it is shown, like Cmd+Shift+K on macOS and Ctrl+Shift+K elsewhere; in words, since the fonts of panels need not have the symbols of the modifier keys