Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit b47c649e46898184f04047f06a0301c7ce280da0
Author: Jordan Baird <[email protected]>
Date:   Sat Feb 4 06:20:11 2023 -0700

    Add new bezel style and rework implementation details

commit 02a3c3c448ec54c681803fb8737552aa7a5862ff
Author: Jordan Baird <[email protected]>
Date:   Sat Feb 4 06:18:34 2023 -0700

    Style changes

commit 39038bac4ca78a226d494341407147e633e5443e
Author: Jordan Baird <[email protected]>
Date:   Sat Feb 4 03:17:23 2023 -0700

    Update KeyCommand.md
  • Loading branch information
jordanbaird committed Feb 4, 2023
1 parent d178b6e commit 865f16f
Show file tree
Hide file tree
Showing 14 changed files with 580 additions and 428 deletions.
10 changes: 5 additions & 5 deletions Sources/SwiftKeys/Documentation.docc/Extensions/KeyCommand.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ command.observe(.keyUp) {
}
```

You can also initialize a command with a predefined key and modifiers. In the following example, the command's observations will be triggered when the key combination "⇧⌥␣" (Shift-Option-Space) is pressed.
You can also initialize a command with a predefined key and modifiers. In the following example, the command's observations will be triggered when the key combination "⌥⇧␣" (Option + Shift + Space) is pressed.

```swift
let command = KeyCommand(
name: "SomeCommand",
key: .space,
modifiers: [.shift, .option]
modifiers: [.option, .shift]
)
```

Expand All @@ -33,7 +33,7 @@ If a key command is created with the same name as one that has been created prev
let originalCommand = KeyCommand(
name: "SomeCommand",
key: .space,
modifiers: [.shift, .option]
modifiers: [.option, .shift]
)

let duplicateCommand = KeyCommand(name: "SomeCommand")
Expand All @@ -45,7 +45,7 @@ print(duplicateCommand.key)
// Prints: "space"

print(duplicateCommand.modifiers)
// Prints: "shift, option"
// Prints: "option, shift"
```

If the example above were to provide a new key and new modifiers in `duplicateCommand`'s initializer, both `duplicateCommand` _and_ `originalCommand` have those values.
Expand All @@ -54,7 +54,7 @@ If the example above were to provide a new key and new modifiers in `duplicateCo
let originalCommand = KeyCommand(
name: "SomeCommand",
key: .space,
modifiers: [.shift, .option]
modifiers: [.option, .shift]
)

let duplicateCommand = KeyCommand(
Expand Down
Loading

0 comments on commit 865f16f

Please sign in to comment.