UTM icon indicating copy to clipboard operation
UTM copied to clipboard

Inserting text from Keyboard Maestro ignores modifier keys like Shift

Open unikitty37 opened this issue 2 years ago • 3 comments

Describe the issue I'm running a macOS Monterey VM using virtualization rather than emulation, so clipboard sharing isn't available to me as Spice tools can't be installed. To work around this, I added the following macro to Keyboard Maestro:

image

However, when I invoke it, all characters that are supposed to be typed with the Shift key are typed without — https://example.com/?a=1&b=2 is typed as https;//example.com//a=17b=2 (with a US keyboard layout — presumably what actually turns up will vary for others).

I'm not sure if this is an issue with Apple's Virtualization framework or UTM, though. Is there a workaround for this (preferably one that gets clipboard sharing working :)

(TBH, my main reason for wanting clipboard sharing is so I can paste passwords from 1Password 7 on the host system. I tried installing it on the VM, but wasn't able to log in to iCloud to get at my vault, as it just says "Verification Failed. The action could not be completed." I was able to find people having similar troubles with Parallels, so I suspect this is a Virtualization framework limitation. Unfortunately, QEMU was far too slow when I tried it, so I have to use Virtualization.)

Configuration

  • UTM Version: 3.2.4 (58)
  • OS Version: macOS 12.4 (21F79)
  • Intel or Apple Silicon? Apple Silicon

Crash log n/a

Debug log Not available in virtualization mode.

Upload VM

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>architecture</key>
	<string>aarch64</string>
	<key>bootLoader</key>
	<dict>
		<key>operatingSystem</key>
		<string>macOS</string>
	</dict>
	<key>consoleCursorBlink</key>
	<true/>
	<key>cpuCount</key>
	<integer>0</integer>
	<key>diskImages</key>
	<array>
		<dict>
			<key>imagePath</key>
			<string>disk0.img</string>
			<key>isExternal</key>
			<false/>
			<key>isReadOnly</key>
			<false/>
			<key>sizeMib</key>
			<integer>102400</integer>
		</dict>
	</array>
	<key>displays</key>
	<array>
		<dict>
			<key>heightInPixels</key>
			<integer>1200</integer>
			<key>pixelsPerInch</key>
			<integer>80</integer>
			<key>widthInPixels</key>
			<integer>1920</integer>
		</dict>
	</array>
	<key>icon</key>
	<string>mac</string>
	<key>iconCustom</key>
	<false/>
	<key>isAppleVirtualization</key>
	<true/>
	<key>isAudioEnabled</key>
	<true/>
	<key>isBalloonEnabled</key>
	<true/>
	<key>isConsoleDisplay</key>
	<false/>
	<key>isEntropyEnabled</key>
	<true/>
	<key>isKeyboardEnabled</key>
	<true/>
	<key>isPointingEnabled</key>
	<true/>
	<key>isSerialEnabled</key>
	<false/>
	<key>macPlatform</key>
	<dict>
		<key>auxiliaryStoragePath</key>
		<string>AuxiliaryStorage</string>
		<key>hardwareModel</key>
		<data>
		YnBsaXN0MDDTAQIDBAUGXxAZRGF0YVJlcHJlc2VudGF0aW9uVmVyc2lvbl8Q
		D1BsYXRmb3JtVmVyc2lvbl8QEk1pbmltdW1TdXBwb3J0ZWRPUxQAAAAAAAAA
		AAAAAAAAAAABEAKjBwgIEAwQAAgPKz1SY2VpawAAAAAAAAEBAAAAAAAAAAkA
		AAAAAAAAAAAAAAAAAABt
		</data>
		<key>machineIdentifier</key>
		<data>
		YnBsaXN0MDDRAQJURUNJRBMeTOuAJUC2DQgLEAAAAAAAAAEBAAAAAAAAAAMA
		AAAAAAAAAAAAAAAAAAAZ
		</data>
	</dict>
	<key>memorySize</key>
	<integer>8589934592</integer>
	<key>name</key>
	<string>Gate365</string>
	<key>networkDevices</key>
	<array>
		<dict>
			<key>macAddress</key>
			<string>16:a3:45:80:0c:35</string>
			<key>networkMode</key>
			<string>Shared</string>
		</dict>
	</array>
	<key>version</key>
	<integer>3</integer>
</dict>
</plist>

unikitty37 avatar Jul 04 '22 13:07 unikitty37

I've had confirmation that it doesn't do it in Parallels, so it might be a UTM issue after all. https://forum.keyboardmaestro.com/t/insert-text-by-typing-mangles-urls-taken-from-the-system-clipboard/28244/13

unikitty37 avatar Jul 04 '22 15:07 unikitty37

From a cursory skim of the relevant UTM code it looks like we use VZVirtualMachineView as-is without custom input handling. So it could be an Apple bug either in SwiftUI or Virtualization framework – or I missed something.

How does Keyboard Maestro send the key events? Would be interesting to compare regular typing and KM paste-typing.

conath avatar Jul 08 '22 23:07 conath

Still haven't been able to get any information on how Keyboard Maestro sends the events, unfortunately 😞

I'll do a bit more digging when I have a little more time…

unikitty37 avatar Jul 18 '22 14:07 unikitty37