In Ctrl of my Alt – finally


Back from a rather long holiday – did you miss me? πŸ˜‰

Well Apple certainly has been busy since I’ve been away. They launched the new iPhone 3G and managed to screw it up by leaving new users unable to activate their phones in the O2 stores. And what about MobileMe? Refunds to users, free 31 day extensions, what are they up to?! Anyway, more on that later because I really just want to share a quick Synergy tip with you.

Synergy

Synergy

As you probably know, I’ve been using Synergy to share my PC keyboard & mouse with my Mac and it works really well. However, there was one thing that always caught me out and that’s how the Mac uses different keys for different things. As a long time Windows user, my biggest bugbear is how the Mac changes with the COPY/PASTE keys, insisting on using Cmd+ C or Cmd + V. This means that on my Synergy setup I had to do a finger-twisting Alt + C and Alt + V when on the Mac screen to copy and paste, then reverting to doing it ‘properly’ when back on the PC.

Not any more!

Let me first say that I didn’t ‘RTFM’ (well at least properly) when I started using Synergy, I just wanted to get

Next time... Read the manual!

Next time... Read the manual!

the keyboard/mouse sharing working. I eventually forgot about Synergy’s help files and the result was that I started looking at key remapping software for the Mac to try and swap the Ctrl and Alt keys round. While I did find some suitable programs, I shied away from actually installing any of them, scared off by the fact that they’re all kernel extensions that carry with them the warnings of kernel panics if things go wrong. I haven’t had a kernel panic yet (touch wood) and I didn’t intend to tempt fate just to remap a couple of keys.

So I eventually returned to browsing through the Synergy web site again and there it was… the answer – Synergy will remap keys for you! Yes, you can tell the Synergy ‘server’ (in my case my PC) to remap keys for selected screens, so for example when the Ctrl key is pressed on the server, it should be treated as the Alt key being pressed on the Mac. All that’s needed is to add a couple of lines to the Synergy config file (C:\Windows\synergy.sgc) on the server machine, like this:

section: screens
  homepc01:
    switchCorners = none
    switchCornerSize = 0
  homepc02:
    switchCorners = none
    switchCornerSize = 0
  laptop:
    switchCorners = none
    switchCornerSize = 0
  macpro:
    switchCorners = none
    switchCornerSize = 0
    ctrl = alt
    alt = ctrl
  susepc:
    switchCorners = none
    switchCornerSize = 0
end
section: links
  homepc01:
    left = homepc02
    right = macpro
    up = susepc
  homepc02:
    left = laptop
    right = homepc01
  ibmlaptop:
    right = homepc02
  macpro:
    left = homepc01
  susebox:
    right = homepc01
end
section: options
end

The two important lines are the ones shown in red. It tells the server that for the macpro the Ctrl key should map to the Alt key and vice versa.

It works a treat, no more hitting the wrong key combination when I’m using the Mac. Obviously if you’re more used to the Mac and you’re using it as your Synergy server, then you can do this the other way round and make the Windows keystrokes behave like the Mac ones. I’m just pleased that I finally got it working as I’m using the Mac more and more, and the Windows PCs less and less.

Back to work for now, but I’ll be having a rant about Orange UK soon, and counting my blessings for sticking with Calgoo and Google calendar rather than imersing myself in the mess that’s MobileMe. See you on the flipside.

Advertisements

8 Responses

  1. Mate, that was a seriously good tip. Exact same thing I ran into, not RTFM for synergy, remembering that there was some way to do it without having to install a key mapper on the mac.

    Thanks!

  2. The trick works great but synergy.sgc gets overwritten without the custom values (default file) if you have to quit and restart synergy. The options do not have anything related to recreating the config file so I’m not sure what the way around it is.

  3. thanks so much for pushing me in the right direction. I too forgot Synergy could remap keys on teh fly. Very useful and easier then most of the remapping utilities out there.

  4. I should add that this also works if you’re using your Mac as the Synergy ‘server’, which is what I’m now doing.

  5. @Rodrigo: At least for me, the key was to edit synergy.sgc in My Documents. That was *user* configuration file, and it overrides the *system.*

  6. Brilliant idea. Am doing exactly the same πŸ™‚

  7. I like the title. Nice πŸ™‚

    I went through the modifer key mapping thing a while go. In my situation I have an additional twist. I run Windows7 under Parallels and I have the MacBook totally tricked out so that its uniform across the two OSes on my laptop and on the desktop windows boxes. I was so used to windows mappings that I actually reversed the Mac modifiers (cmd->ctrl, etc) and then reversed mapped again in both parallels and windows.

    Anyway, I’ve got a new challenge. I’m trying to map numeric keypad keys and I’m finding that Synergy seems to be ignoring all the KP_* modifiers. I can easily map things like a->b but anything out of the KP_ seems to be ignored by Synergy and comes strait through as-is on the remote machine.

    Has anyone been able to remap keypad (KB_*) keys?

    here are a couple of mappings for example:
    keystroke(KP_0) = keystroke(F11)
    keystroke(KP_Insert) = keystroke(F11)
    I’ve also tried to add screen names:
    keystroke(KP_0) = keystroke(F11,mach2)
    keystroke(KP_Insert) = keystroke(F11,mach2)

    p.s. On the Mac, try out SynergyKM. Very nice UI to Synergy and side-steps the need to write login scripts.

  8. Thank you! I spent too much time messing around with remapping the keys within Windows + Ubuntu (my client machine, controlled by my server macbook pro) instead of just remapping the ctrl + alt keys within synergy on my MBP. Works like a charm now! Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: