Seeing Keys to Microsoft Remote Desktop

I'm trying to send Control-C and Control-V to the remote device (Windows 7) but the "Control" seems to be being ignored. What am I missing?

Raw AppleScript sends them OK...

tell application "Microsoft Remote Desktop"
	activate
	tell application "System Events"
		-- type Square brackets
		key code 33
		key code 30
		-- type curly brackets
		key code 33 using {shift down}
		key code 30 using {shift down}
		keystroke "testing"
		-- type 3 shift left arrows (select last 3 characters)
		key code 123 using {shift down}
		key code 123 using {shift down}
		key code 123 using {shift down}
		key code 123 using {shift down}
		-- copy and paste 3 times
		key code 8 using {control down}
		key code 9 using {control down}
		key code 9 using {control down}
		key code 9 using {control down}
		key code 36 --return
		key code 48 --tab
		keystroke "finished"
	end tell
end tell

But is seems like KM is not sending any modifier strokes
@gravejd asked a similar question in March with no resolution.

Regards
Mike

1 Like

That appears to be all AppleScript, so if that is not working you probably wont get any better results asking Keyboard Maestro to type the keys or modifiers.

Hi Peter
No the AS works perfectly, When I tell KM to send a Control V, I just get a V (no control)
Mike
(Anarchy user back in OS7.6)

That is using Remote Desktop Version 8.0.35 (Build 27221) and the Bete Version 8.2.26. I have not upgraded to Sierra yet. The Bete does have the ability to remap Ctl X,V & C but I would also like to be able to add Cmd A & W.

Is there any diagnostics I can send from KM that would help? I have been using the debugger to step through the actions. Shift and Control just don’t get sent.

Mike

Can you post the Macro (image and file) that you are using?

I use the KM Action “Type a Keystroke” all the time with the modifier keys, including “CTRL”. So I don’t know why it would not work for you, unless the app you are using the macro with is eating these keystrokes.

Ahh, I see. I wonder what they do differently.

Does that work connecting to a Mac, or only to a Windows box. If the latter, then I have no way of testing it.

Unfortunately, these sort of low level apps may be sensitive to anything.

@msavory , did you ever solve this challenge? I am using KM to control Microsoft Remote Desktop with a Windows 10 machine on the other end. Same challenge, I send Ctrl + E and Remote Desktop only receives E.

I too encountered the same issue trying to send keys to Microsoft Remote Desktop: all modifier keys were being stripped, so I was only getting lowercase printable characters. I tried the AppleScript method, but that too did not work for me on macOS 10.15.6. Finally, I was able to achieve what I wanted by using yet another tool: hammerspoon. Doing so feels very low-level since one has to write Lua code to perform individual key down/up sequences (including modifiers) so that RDP will pass it along unmolested. The is a lot of functionality available but IMO it takes a lot of effort to get what KM can deliver -- I use palettes a lot for instance. Good luck!

@BradHowes - Would you mind sharing how configured Hammerspoon to send keys to Microsoft Remote Desktop? Unfortunately, the same problem still exists today w/ MRD and KM. Thanks

1 Like

This has been happening to me too. Finally found the answer here. The fix is to change the Microsoft Remote Desktop for MacOS keyboard connection to use Unicode.

It is located in the menu of an open RDP session under "Connections"->"Keyboard Mode". There you have two choices, either scancode or Unicode.

2 Likes

Thank you @mbarton98 , this has bugged me for years! Works a treat!

2 Likes