DropletShortcutEntry
One shortcut a droplet keeps itself, listed on Droppy's Shortcuts page.
struct DropletShortcutEntry
For a droplet that runs its own hotkeys rather than registering them with DropletShortcutsService: the entry is how Droppy reads the binding, records a new one with its own recorder and bubble, and hands it back. Every shortcut in Droppy is set on its Shortcuts page and nowhere else, so a droplet lists every binding it can hold here, not only the bound ones.
Initializers
init(id:title:subtitle:group:shortcut:setShortcut:displayTitle:isTaken:onRecordingChanged:reset:)
init(id: String, title: String, subtitle: String? = nil, group: String? = nil, shortcut: @escaping @MainActor () -> DropletKeyboardShortcut?, setShortcut: @escaping @MainActor (DropletKeyboardShortcut?) -> Void, displayTitle: (@MainActor () -> String?)? = nil, isTaken: (@MainActor (DropletKeyboardShortcut) -> Bool)? = nil, onRecordingChanged: (@MainActor (Bool) -> Void)? = nil, reset: (@MainActor () -> Void)? = nil)
Properties
displayTitle
let displayTitle: (@MainActor () -> String?)?
The row's title for a binding that is not a chord (a double tap).
group
let group: String?
Consecutive entries with the same group share one titled card.
id
let id: String
Stable across launches: it is the row's search anchor.
isTaken
let isTaken: (@MainActor (DropletKeyboardShortcut) -> Bool)?
Refuses a chord the droplet already uses for something else.
onRecordingChanged
let onRecordingChanged: (@MainActor (Bool) -> Void)?
Told when the bubble opens and closes, so the droplet can pause its own hotkeys while one is being pressed.
reset
let reset: (@MainActor () -> Void)?
Restores the droplet's default binding. nil when there is none.
setShortcut
let setShortcut: @MainActor (DropletKeyboardShortcut?) -> Void
Stores the user's chord, or clears the binding with nil.
shortcut
let shortcut: @MainActor () -> DropletKeyboardShortcut?
The chord, or nil when unbound or bound to something a chord cannot say (see displayTitle).
subtitle
let subtitle: String?
The explanation in the row's info tip.
title
let title: String