Using a Windows Keyboard on macOS while Screen Sharing back into Windows

Hello All,

I use a Mac at home, with a Microsoft Sculpt Ergonomic Keyboard. I love the keyboard, and have swapped the command (⌘) and option (⌥) keys in Keyboard.prefpane so that they are physically in the same location as an Apple keyboard.

This makes my “alt” key command (⌘) and Windows key option (⌥)

I like working this way for all my Mac needs, but when I screen share into many different Windows computers (for work using Microsoft Remote Desktop or Parsec) I’d like the Windows key to become a Windows key again and the alt key to become an alt key again.

Question: Is there a way to swap them back but only while in a specific application?

I’ve setup an application macro group in Keyboard Maestro and selected Parsec and Microsoft Remote Desktop with the following macros:

While this seems to work for the Windows key (although sometimes inconsistent). I can’t get it to work with the alt key. I’ve tried:

tell application "System Events"
	key code 58 #<- option's key code
end tell

as well as:

tell application "System Events"
	key down option
	key up option
end tell

Which does work for the Windows key (using command instead of option of course).

Any thoughts on other ways to approach this in Keyboard Maestro?

Maybe use Karabiner Elements and switch profiles and define the key switch within that app?

Keyboard Maestro may well be able to automate the profile switching for you, but I’d be tempted to tie it to a manual trigger rather than focus and defocus for an app.

1 Like