Remap side touch button on Microsoft Sculpt Comfort Mouse

I just bought one myself and found that the following workes perfectly for me.

  1. Open dconf-editor (sudo apt-get install dconf-editor if it isn't already installed).
  2. Navigate to org -> gnome -> desktop -> wm -> keybindings.
  3. Change the value of switch-to-workspace-down to

    ['<Control><Alt>Down', '<Primary><Super>Tab', '<Control><Super>Tab']

    and the value of switch-to-workspace-up to

    ['<Control><Alt>Up', '<Primary><Super>BackSpace', '<Control><Super>Backspace']


So since the Microsoft Sculpt Comfort Mouse isn't registering mouse button presses for the super and swipe gestures, but instead is registering keyboard key presses, I used the 'xautomation' and 'xbindkeys' packages to listen for those key presses and send Ctrl+Alt+Right/Left to switch between workspaces. It's not an ideal solution, but it works like 8 out of 10 times.

#Move to left workspace
"xte 'keydown Control_L' 'keydown Alt_L' 'usleep 100' 'key Left' 'keyup Control_L' 'keyup Alt_L' 'keyup Left'"
   m:0x4+mod4+m:0x0+c:23
   #Control_L+Super_L+Tab

#Move to right workspace
"xte 'keydown Control_L' 'keydown Alt_L' 'usleep 100' 'key Right' 'keyup Control_L' 'keyup Alt_L' 'keyup Right'"
   m:0x4+mod4+m:0x0+c:22
   #Control_L+Super_L+Backspace

What this xbindkeys script does is it listens for the keypresses that the mouses swipe up and swipe down gestures send to the computer. If detected, xautomation sends the standard move desktop keystroke, control+alt+left/right.

The swipe up gesture on the mouse sends the keystroke of left control+left super+backspace. The swipe down gesture on the mouse sends the keystroke left control+left super+tab. m:0x4+mod4+m:0x0+c22 is the actual key code combination that gets detected by xbindkeys.

I'll mess with it a bit more to see if I can improve the efficiency, but for now this gets the job done. I just hope the tab and backspace that the mouse outputs don't screw with any work that I'm doing.