Most of my development time is spent using Visual Studio, and I have grown quite attached to many of the keyboard shortcuts. Specifically, the “Save All” shortcut. By default, this is mapped to the hotkey combination, CTRL+SHIFT+S. I hit this shortcut all the time….like, every time I stop typing and definitely before I build.
For many years, I’ve done this with no particularly bad side effects. That is until Microsoft Communicator became Microsoft Lync and overrides the Ctrl-Shift-S keyboard shortcut.
The Problem
I frequently use Microsoft Lync to share my desktop with remote workers or vice-versa. This works pretty well and is reliable. However, hitting Ctrl-Shift-S during a Lync sharing session will end the sharing session without any hesitation or confirmation. This wouldn’t be so bad if it only took effect when the Lync window is active, but that’s not the case. It’s registered globally, so the sharing is killed when I’m just trying to Save-All in Visual Studio.
There’s another unfortunate side effect where if you’re in control of a remote sharing session, and you hit Ctrl-Shift-S, not only will you end the sharing session, but you’ll also leave the remote computer’s keyboard in an unusable state. What happens is that the Ctrl and/or Shift key gets logically stuck in pressed state. So anything the remote user (that you’ve been disconnected from) tries to do with keyboard executes as if the user is holding down the Ctrl and/or Shift key. As you can imagine, this causes all sorts of undesirable side-effects.
By the way, the fix for the stuck keyboard is to have the user press the Ctrl key, release, press Shift key, release.
The Fix
Lance Hilliard has created a AutoHotKey script to effectively disable the Ctrl-Shift-S keyboard shortcut for Lync.
I don’t use AutoHotKey regularly, so I created a standalone EXE from Lance’s script and I just keep it running in the background.
This turned out to be an easy task. Steps to follow:
Ahk2Exe.exe /in "..\Extras\Scripts\AllowSaveAllInVisualStudioWhenLyncScreenSharingIsBeingUsed.ahk"
- Download the AllowSaveAllInVisualStudioWhenLyncScreenSharingIsBeingUsed.ahk script from Lance’s github store
- You’ll need to use the Ahk2Exe utility, so download it if necessary. If you’re already using AutoHotKey, you probably already have it in the Compiler folder in your AutoHotKey install directory.
- From a command-line prompt, use the Ahk2Exe.exe utility to convert the script into a standalone EXE.
Here’s the command I used – you’ll need to adjust your paths accordingly: - Now just launch the newly-created EXE and let it run in the background.
Conclusion
I have used this solution for a while with no issues. I use Visual Studio keyboard shortcuts extensively, but I don’t really use the Lync shortcuts at all. That makes this a perfect solution for me. If you have any ideas for improvement, well, that’s probably why it’s on GitHub, so go ahead, fork and commit to your heart’s content!