@@ -51,7 +51,9 @@ class VM: NSObject, VZVirtualMachineDelegate, ObservableObject {
5151 clipboard: Bool = true ,
5252 sync: VZDiskImageSynchronizationMode = . full,
5353 caching: VZDiskImageCachingMode ? = nil ,
54- noTrackpad: Bool = false
54+ noTrackpad: Bool = false ,
55+ noPointer: Bool = false ,
56+ noKeyboard: Bool = false
5557 ) throws {
5658 name = vmDir. name
5759 config = try VMConfig . init ( fromURL: vmDir. configURL)
@@ -73,7 +75,9 @@ class VM: NSObject, VZVirtualMachineDelegate, ObservableObject {
7375 clipboard: clipboard,
7476 sync: sync,
7577 caching: caching,
76- noTrackpad: noTrackpad
78+ noTrackpad: noTrackpad,
79+ noPointer: noPointer,
80+ noKeyboard: noKeyboard
7781 )
7882 virtualMachine = VZVirtualMachine ( configuration: configuration)
7983
@@ -316,7 +320,9 @@ class VM: NSObject, VZVirtualMachineDelegate, ObservableObject {
316320 clipboard: Bool = true ,
317321 sync: VZDiskImageSynchronizationMode = . full,
318322 caching: VZDiskImageCachingMode ? = nil ,
319- noTrackpad: Bool = false
323+ noTrackpad: Bool = false ,
324+ noPointer: Bool = false ,
325+ noKeyboard: Bool = false
320326 ) throws -> VZVirtualMachineConfiguration {
321327 let configuration = VZVirtualMachineConfiguration ( )
322328
@@ -356,8 +362,16 @@ class VM: NSObject, VZVirtualMachineDelegate, ObservableObject {
356362 configuration. keyboards = platformSuspendable. keyboardsSuspendable ( )
357363 configuration. pointingDevices = platformSuspendable. pointingDevicesSuspendable ( )
358364 } else {
359- configuration. keyboards = vmConfig. platform. keyboards ( )
360- if noTrackpad {
365+
366+ if noKeyboard {
367+ configuration. keyboards = [ ]
368+ } else {
369+ configuration. keyboards = vmConfig. platform. keyboards ( )
370+ }
371+
372+ if noPointer {
373+ configuration. pointingDevices = [ ]
374+ } else if noTrackpad {
361375 configuration. pointingDevices = vmConfig. platform. pointingDevicesSimplified ( )
362376 } else {
363377 configuration. pointingDevices = vmConfig. platform. pointingDevices ( )
0 commit comments