Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Give Keychain Browser and the screenshot items keys that reach them

Jackycdf4ffd81cd6
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuData.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuData.swift
index b8c6c2b9..03edb607 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuData.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuData.swift
@@ -21,11 +21,13 @@ extension VPhoneMenuController {
connectFileBrowserItem = fileBrowser
menu.addItem(fileBrowser)
+ // Control-Command-K: Shift-Command-K is Device > Use Hardware Keyboard,
+ // which comes first in the menu bar and would take the key.
let keychainBrowser = makeItem(
"Keychain Browser",
action: #selector(openKeychain),
keyEquivalent: "k",
- modifiers: [.command, .shift],
+ modifiers: [.command, .control],
symbol: "key",
)
keychainBrowser.isEnabled = false
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuRecord.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuRecord.swift
index ae97f337..5dbcec76 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuRecord.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuRecord.swift
@@ -16,19 +16,21 @@ extension VPhoneMenuController {
recordingItem = toggle
menu.addItem(toggle)
menu.addItem(NSMenuItem.separator())
- // Shift-Command-3 and -4 keep the macOS screenshot muscle memory: the
- // file first, the clipboard second.
+ // Not Shift-Command-3 and -4: those are the Mac's own screenshot hot
+ // keys, which the window server takes before the menu sees them (see
+ // `VPhoneHostHotKeys`). Control-Command-C is Simulator's Copy Screen;
+ // saving is Shift-Command-S, since a plain Command-S is the guest's.
menu.addItem(makeItem(
"Copy Screenshot to Mac Clipboard",
action: #selector(copyScreenshotToClipboard),
- keyEquivalent: "4",
- modifiers: [.command, .shift],
+ keyEquivalent: "c",
+ modifiers: [.command, .control],
symbol: "camera.viewfinder",
))
menu.addItem(makeItem(
"Save Screenshot to File",
action: #selector(saveScreenshotToFile),
- keyEquivalent: "3",
+ keyEquivalent: "s",
modifiers: [.command, .shift],
symbol: "square.and.arrow.down",
))