mac client to windows server: remap command key to control?

i want the command key on my mac keyboard to map to control key on the windows server.

i want option key to stay alt, and i want control key to map to windows key

how do i do that?

2

Comments

3 comments
  • I use an autohotkey script to do that. actually there is no native possibility to change the key mapping: #c::
    {
    Send "^c"
    }
     
    #x::
    {
    Send "^x"
    }
     
    #v::
    {
    Send "^v"
    }
    0
    Comment actions Permalink
  • I'd also love this option, for controlling a Mac from a Windows PC. Software KVM like Synergy, Sharemouse, et al, can all do this. Surely it would be trivial for RealVNC to offer a basic option to swap the modifier keys?

    0
    Comment actions Permalink
  • I've finally found the built-in solution for swapping modifier keys (or any other keys for that matter):

    1. On the MacOS Server, open RealVNC Connect's Server settings.
    2. Look for the option called "RemapKeys"
    3. Enter the following:
    4. 0xffe3<>0xffe7
    5. Apply and enjoy your swapped Left Control and Left Command keys

    Why this works:

    This is the documentation for RemapKeys:
    https://help.realvnc.com/hc/en-us/articles/360002251297-RealVNC-Server-Parameter-Reference#remapkeys-0-103

    This mentions X11 keysyms, a list of which I found here: https://www.cl.cam.ac.uk/~mgk25/ucs/keysymdef.h

    We are interested in the modifiers:

    #define XK_Shift_L                       0xffe1  /* Left shift */
    #define XK_Shift_R                       0xffe2  /* Right shift */
    #define XK_Control_L                     0xffe3  /* Left control */
    #define XK_Control_R                     0xffe4  /* Right control */
    #define XK_Caps_Lock                     0xffe5  /* Caps lock */
    #define XK_Shift_Lock                    0xffe6  /* Shift lock */
    
    #define XK_Meta_L                        0xffe7  /* Left meta */
    #define XK_Meta_R                        0xffe8  /* Right meta */
    #define XK_Alt_L                         0xffe9  /* Left alt */
    #define XK_Alt_R                         0xffea  /* Right alt */
    #define XK_Super_L                       0xffeb  /* Left super */
    #define XK_Super_R                       0xffec  /* Right super */
    #define XK_Hyper_L                       0xffed  /* Left hyper */
    #define XK_Hyper_R                       0xffee  /* Right hyper */

    So using the syntax described in the RealVNC docs, we swap XK_Control_L with XK_Meta_L for the win.

    Small word of caution: Because this is controlled by the VNC Server, it will apply to any client that connects. So if you connect to that Mac from both Windows and another Mac, this might not be the solution for you. But it's brilliant when it's always Windows -> Mac.

    Hope this helps someone out there.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post