parent
7339e5ff02
commit
44f5f857b4
|
@ -35,6 +35,8 @@ class VMDisplayAppleDisplayWindowController: VMDisplayAppleWindowController {
|
||||||
|
|
||||||
private var aspectRatioLocked: Bool = false
|
private var aspectRatioLocked: Bool = false
|
||||||
|
|
||||||
|
@Setting("FullScreenAutoCapture") private var isFullScreenAutoCapture: Bool = false
|
||||||
|
|
||||||
override func windowDidLoad() {
|
override func windowDidLoad() {
|
||||||
mainView = VZVirtualMachineView()
|
mainView = VZVirtualMachineView()
|
||||||
captureMouseToolbarButton.image = captureMouseToolbarButton.alternateImage // show capture keyboard image
|
captureMouseToolbarButton.image = captureMouseToolbarButton.alternateImage // show capture keyboard image
|
||||||
|
@ -89,14 +91,18 @@ class VMDisplayAppleDisplayWindowController: VMDisplayAppleWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
func windowDidEnterFullScreen(_ notification: Notification) {
|
func windowDidEnterFullScreen(_ notification: Notification) {
|
||||||
|
if isFullScreenAutoCapture {
|
||||||
captureMouseToolbarButton.state = .on
|
captureMouseToolbarButton.state = .on
|
||||||
captureMouseButtonPressed(self)
|
captureMouseButtonPressed(self)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func windowDidExitFullScreen(_ notification: Notification) {
|
func windowDidExitFullScreen(_ notification: Notification) {
|
||||||
|
if isFullScreenAutoCapture {
|
||||||
captureMouseToolbarButton.state = .off
|
captureMouseToolbarButton.state = .off
|
||||||
captureMouseButtonPressed(self)
|
captureMouseButtonPressed(self)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func windowDidResize(_ notification: Notification) {
|
func windowDidResize(_ notification: Notification) {
|
||||||
if aspectRatioLocked && supportsReconfiguration {
|
if aspectRatioLocked && supportsReconfiguration {
|
||||||
|
|
|
@ -61,6 +61,7 @@ class VMDisplayQemuMetalWindowController: VMDisplayQemuWindowController {
|
||||||
@Setting("NoCursorCaptureAlert") private var isCursorCaptureAlertShown: Bool = false
|
@Setting("NoCursorCaptureAlert") private var isCursorCaptureAlertShown: Bool = false
|
||||||
@Setting("NoFullscreenCursorCaptureAlert") private var isFullscreenCursorCaptureAlertShown: Bool = false
|
@Setting("NoFullscreenCursorCaptureAlert") private var isFullscreenCursorCaptureAlertShown: Bool = false
|
||||||
@Setting("DisplayFixed") private var isDisplayFixed: Bool = false
|
@Setting("DisplayFixed") private var isDisplayFixed: Bool = false
|
||||||
|
@Setting("FullScreenAutoCapture") private var isFullScreenAutoCapture: Bool = false
|
||||||
@Setting("CtrlRightClick") private var isCtrlRightClick: Bool = false
|
@Setting("CtrlRightClick") private var isCtrlRightClick: Bool = false
|
||||||
@Setting("AlternativeCaptureKey") private var isAlternativeCaptureKey: Bool = false
|
@Setting("AlternativeCaptureKey") private var isAlternativeCaptureKey: Bool = false
|
||||||
@Setting("IsCapsLockKey") private var isCapsLockKey: Bool = false
|
@Setting("IsCapsLockKey") private var isCapsLockKey: Bool = false
|
||||||
|
@ -379,15 +380,19 @@ extension VMDisplayQemuMetalWindowController {
|
||||||
|
|
||||||
func windowDidEnterFullScreen(_ notification: Notification) {
|
func windowDidEnterFullScreen(_ notification: Notification) {
|
||||||
isFullScreen = true
|
isFullScreen = true
|
||||||
|
if isFullScreenAutoCapture {
|
||||||
captureMouseToolbarButton.state = .on
|
captureMouseToolbarButton.state = .on
|
||||||
captureMouse()
|
captureMouse()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func windowDidExitFullScreen(_ notification: Notification) {
|
func windowDidExitFullScreen(_ notification: Notification) {
|
||||||
isFullScreen = false
|
isFullScreen = false
|
||||||
|
if isFullScreenAutoCapture {
|
||||||
captureMouseToolbarButton.state = .off
|
captureMouseToolbarButton.state = .off
|
||||||
releaseMouse()
|
releaseMouse()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override func windowDidResignKey(_ notification: Notification) {
|
override func windowDidResignKey(_ notification: Notification) {
|
||||||
releaseMouse()
|
releaseMouse()
|
||||||
|
|
|
@ -37,7 +37,7 @@ struct SettingsView: View {
|
||||||
.tabItem {
|
.tabItem {
|
||||||
Label("Input", systemImage: "keyboard")
|
Label("Input", systemImage: "keyboard")
|
||||||
}
|
}
|
||||||
}.frame(minWidth: 600, minHeight: 300, alignment: .topLeading)
|
}.frame(minWidth: 600, minHeight: 350, alignment: .topLeading)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +128,7 @@ struct SoundSettingsView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct InputSettingsView: View {
|
struct InputSettingsView: View {
|
||||||
|
@AppStorage("FullScreenAutoCapture") var isFullScreenAutoCapture = false
|
||||||
@AppStorage("OptionAsMetaKey") var isOptionAsMetaKey = false
|
@AppStorage("OptionAsMetaKey") var isOptionAsMetaKey = false
|
||||||
@AppStorage("CtrlRightClick") var isCtrlRightClick = false
|
@AppStorage("CtrlRightClick") var isCtrlRightClick = false
|
||||||
@AppStorage("AlternativeCaptureKey") var isAlternativeCaptureKey = false
|
@AppStorage("AlternativeCaptureKey") var isAlternativeCaptureKey = false
|
||||||
|
@ -138,6 +139,12 @@ struct InputSettingsView: View {
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Form {
|
Form {
|
||||||
|
Section(header: Text("Mouse/Keyboard")) {
|
||||||
|
Toggle(isOn: $isFullScreenAutoCapture) {
|
||||||
|
Text("Capture input automatically when entering full screen")
|
||||||
|
}.help("If enabled, input capture will toggle automatically when entering and exiting full screen mode.")
|
||||||
|
}
|
||||||
|
|
||||||
Section(header: Text("Console")) {
|
Section(header: Text("Console")) {
|
||||||
Toggle(isOn: $isOptionAsMetaKey, label: {
|
Toggle(isOn: $isOptionAsMetaKey, label: {
|
||||||
Text("Option (⌥) is Meta key")
|
Text("Option (⌥) is Meta key")
|
||||||
|
@ -182,6 +189,7 @@ extension UserDefaults {
|
||||||
@objc dynamic var NoQuitConfirmation: Bool { false }
|
@objc dynamic var NoQuitConfirmation: Bool { false }
|
||||||
@objc dynamic var NoCursorCaptureAlert: Bool { false }
|
@objc dynamic var NoCursorCaptureAlert: Bool { false }
|
||||||
@objc dynamic var DisplayFixed: Bool { false }
|
@objc dynamic var DisplayFixed: Bool { false }
|
||||||
|
@objc dynamic var FullScreenAutoCapture: Bool { false }
|
||||||
@objc dynamic var OptionAsMetaKey: Bool { false }
|
@objc dynamic var OptionAsMetaKey: Bool { false }
|
||||||
@objc dynamic var CtrlRightClick: Bool { false }
|
@objc dynamic var CtrlRightClick: Bool { false }
|
||||||
@objc dynamic var NoUsbPrompt: Bool { false }
|
@objc dynamic var NoUsbPrompt: Bool { false }
|
||||||
|
|
Loading…
Reference in New Issue