Skip to content

Commit

Permalink
Handle F-keys properly
Browse files Browse the repository at this point in the history
Bump KeyCodes to 4.1.1
  • Loading branch information
zenangst committed May 21, 2024
1 parent 132bfe4 commit 38a5839
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions App/Sources/Core/Runners/KeyboardCommandRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ final class KeyboardCommandRunner: @unchecked Sendable {
flags.insert(.maskNumericPad)
}

if keyboardShortcut.key.hasPrefix("F") {
flags.insert(.maskSecondaryFn)
// NX_DEVICELCMDKEYMASK
flags.insert(CGEventFlags(rawValue: 8))
}

let configureEvent: (CGEvent) -> Void = { newEvent in
if let originalEvent {
let originalKeyboardEventAutorepeat = originalEvent.getIntegerValueField(.keyboardEventAutorepeat)
Expand Down
2 changes: 1 addition & 1 deletion Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public enum PackageResolver {
.package(url: "https://github.com/zenangst/Dock.git", from: "1.0.1"),
.package(url: "https://github.com/zenangst/InputSources.git", from: "1.0.1"),
.package(url: "https://github.com/zenangst/Intercom.git", .revision("5a340e185e571d058c09ab8b8ad8716098282443")),
.package(url: "https://github.com/zenangst/KeyCodes.git", from: "4.1.0"),
.package(url: "https://github.com/zenangst/KeyCodes.git", from: "4.1.1"),
.package(url: "https://github.com/zenangst/LaunchArguments.git", from: "1.0.2"),
.package(url: "https://github.com/zenangst/MachPort.git", from: "4.2.0"),
.package(url: "https://github.com/zenangst/Windows.git", from: "1.2.1"),
Expand Down

0 comments on commit 38a5839

Please sign in to comment.