I own both a Mac and a PC, and I have recently started using Synergy in order to use the same mouse and keyboard on both computers. As of right now, the mouse and keyboard are connected to my PC - meaning that I I host the Synergy server on my PC and connect to it on my Mac via a wired network.

I am wondering if someone knows how to remap mouse buttons using Synergy. My mouse has 5 buttons and I would like to use the additional two buttons to bring up Expose and the Desktop on the Mac. As of right now, one of the buttons has no effect when the cursor is on the Mac, and the other actually performs a command on the Windows screen (even when the mouse cursor is on the Mac).

My best guess right now is to use the configuration file in Synergy, as it allows you to remap a lot of user input. In this case, however, I cannot figure out how to refer to the extra mouse buttons in the configuration file (is there a way to find out what they are called). I would also be open to any other suggestions... One thing that might come in handy is that the additional mouse buttons are programmable to almost any command on Windows.

  • Do the additional buttons work if the mouse is directly connected to the Mac? – Daniel Beck Mar 16 '11 at 19:06
  • Yes - what were you thinking? – Berk U. Mar 16 '11 at 19:31
  • Sorry let me rephrase that. The additional buttons do work on the Mac if the mouse is directly connected to the Mac, but in that case they do not work on the PC. I thought maybe there was a way to have the Mac pair up a device driver with Synergy :) – Berk U. Mar 16 '11 at 19:42

If the buttons are programmable under Windows then it means a program is monitoring them before Synergy can see them (which is why pressing a button on a client causes an action to happen on the server.) You will have to stop using that program before the button press will even be sent across to the Mac.

Possibly the only way you could achieve what you're after is to run a program on the Mac that listens for mouse button events and launches programs accordingly. I don't think Synergy can be configured to perform events on mouse/keyboard actions, only to produce other mouse/keyboard events.

  • Thank you for this. It makes a lot of sense to me. I can turn off the default MS Keyboard + Mouse program. Do you know about a program for Mac that listens for mouse button events and launches programs accordingly? – Berk U. Mar 25 '11 at 15:47
  • I haven't tried them with Synergy yet, but ControllerMate and Steermouse are intended to intercept physically connected mouse and keyboard events. – curt Jul 31 '11 at 18:58

If anyone is having trouble with this today, consider the following:

In your mac Client, go to system preferences/keyboard/shortcuts and search through the different categories for the actions you are looking for. You can remap the shortcuts there by selecting the right column and entering the mouse key by pressing on the desired mouse button where the input bar is blinking.

If the action you are looking for is not there, such as the "Back" or "Forward" commands, go to App Shortcuts in the left column, and add a new one by pressing the + sign at the bottom left. Enter the Menu Title you desire, such as "Back", "Cut", or "Undo", and proceed by mapping your desired mouse button as described earlier.

If you are having trouble with this, go to your Server computer and try to assign new keystrokes to the different mouse buttons using the mouse-specific software (e.g. Logitech SetPoint Software).

Keep in mind you can also remap the Modifier Keys for your client, which you can do by accessing Synergy on your server computer, clicking on Configure Server..., selecting your Client icon from the grid and changing your Modifier keys from "Ctrl" on the right side to "Super" on the left, and from "Super" on the left side to "Ctrl" on the right.

This will allow you to use the same Modifier Keys on both computers, in order to use the same mouse shortcuts on both platforms. I'm using Alt+Left in both my Mac and Windows systems to go "Back" in applications such as Chrome.

  • This has worked for me in the past, though yesterday I remapped some functions to many different keyboard combos that just never actually worked. Weird. That was a Mac-to-Mac Synergy setup. No matter, I probably PEBKACed somehow. – James T Snell Jan 10 '17 at 17:41

For debugging what Synergy is seeing (and sending, because it has some built in remappings that have caused me no end of headaches), you can go into the Edit> Settings (Windows/Linux) or Synergy> Preferences or cmd+, (macOS) and change the logging level to Debug1 on each system and then save in the Settings/Preferences dialog and then Apply in the main Synergy UI to get the more verbose output.

While your cursor is on the "Server" machine you won't see any output when hitting the mouse buttons, but if you move over to a client machine you will see the button/keys it recognized in the server's log and in the client log you will see the key that it actually received/remapped.

One thing you will probably quickly notice if you are also familiar with xev -event button or xinput list and xinput test -event button deviceIdFromList is that the events don't match up exactly with what Synergy is reporting. For example from my Logitech mice, buttons 8/9 are WWWBack/WWWForward but Synergy reports them as 6/7. So when you are remapping you need to use the Synergy numbers not the xev numbers.

If your client machine is macOS, you will want to remap 6/7 to a keystroke(Meta+[) or keystroke(Meta+]) for Back/Forward, if your client machine is Windows you probably want to remap 6/7 to mousebutton(4) and mousebutton(5).

See this comment and others in the same thread, https://github.com/symless/synergy-core/issues/58#issuecomment-248043811

A tricky bit that I've run into repeatedly is you will probably need to create a new Synergy config (try using Save Configuration As) and load that file with "Using existing configuration" instead of using the interactive configuration, because I've run into cases where the interactive config only allows mapping buttons up to mouse button 4, hitting the forward/back or other keys it just always shows mousebutton(4).

Then you can use a couple lines like this to make the change.

# For Mac clients
mousebutton(6) = keystroke(Meta+[,macname)
mousebutton(7) = keystroke(Meta+],macname)

# For Windows clients
mousebutton(6) = mousebutton(4,winPC-123)
mousebutton(7) = mousebutton(5,winPC-123)

If you have all clients using the same OS so you want to remap it the same way on all, you can omit the screen names, but maybe you don't want to remap it on certain machines, that's where the : separated list of screen names can be useful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.