plus
This operator function enables the concatenation with a Shortcut:
Keys.Alt + Shortcut("K")
Content copied to clipboard
See also
This operator function enables the concatenation with simply a String to enable a nice readable keyboard combination:
Keys.Shift + "F"
Content copied to clipboard
Be aware that the Shortcut.key property is case sensitive just likte the KeyboardEvent.key property. So in order to match a shortcut with a capital key of an event, you must the Shortcut.shift flag to true
.
// A capital "K" should be matched, but would fail here:
keydowns.map { shortcutOf(it) == Shortcut("K") } // would emit `false`!
// Instead this will work:
keydowns.map { shortcutOf(it) == Shortcut("K", shift = true) }
// or with this operator an better readbility:
keydowns.map { shortcutOf(it) == Keys.Shift + "K" }
Content copied to clipboard