Changes the public API from creating a KeyboardShortcut from the public KeyboardAction type to using a KeyboardKit namespace on KeyboardShortcut. This needs a fair amount of extra internal boilerplate, but in exchange the API is more succinct at the call site, and it works much better with autocompletion. This changes the call site like this:
KeyboardAction has been made private, renamed to KeyboardInput and changed from an enum to a struct because I find it nicer having all the properties defined in one place rather than spread between multiple switch statements. Conceptually, the input is not a finite set of values. One benefit of this is the definitions for disabling automatic mirroring are now in one place.
Adds documentation for this new functionality in the README etc.
Adds a SwiftUI example in the demo app showing the new support
This is a follow up to https://github.com/douglashill/KeyboardKit/pull/23.
Changes the public API from creating a
KeyboardShortcut
from the publicKeyboardAction
type to using aKeyboardKit
namespace onKeyboardShortcut
. This needs a fair amount of extra internal boilerplate, but in exchange the API is more succinct at the call site, and it works much better with autocompletion. This changes the call site like this:KeyboardAction
has been made private, renamed toKeyboardInput
and changed from an enum to astruct
because I find it nicer having all the properties defined in one place rather than spread between multiple switch statements. Conceptually, the input is not a finite set of values. One benefit of this is the definitions for disabling automatic mirroring are now in one place.Adds documentation for this new functionality in the README etc.
Adds a SwiftUI example in the demo app showing the new support