Windows 8 shortcut
Setting UIAccess=true in the executable's embedded manifest appears to solve this problem. The executable must also be in a trusted location, such as the Program Files folder. For more information and a script which makes the necessary modification for you, see EnableUIAccess.
Thanks to Cliff Smolinsky for posting the following on the Synergy issue tracker:
A number of security changes have been implemented in Windows 8 which prevent programs which are not Metro apps from injecting keys that would remove you from the Metro environment. The way this works is that the keyboard shortcut is ignored if it doesn't come from a physical keyboard or a program that has the appropriate permissions. [...] In order to have the proper permissions, the program must be built with UIAccess (see http://msdn.microsof...y/ms742884.aspx).
I was unable to confirm this via any official source, aside from the following vague comment at MSDN:
An accessibility application can use SendInput to inject keystrokes corresponding to application launch shortcut keys that are handled by the shell. This functionality is not guaranteed to work for other types of applications.
I don't have windows 8 to test with and I'm nowhere near as skilled as Lexikos, but you might be able to solve your issue by running the script as Admin.
EDIT: Running as Admin does nothing to help this situation.
Send #d
with an unmodified AutoHotkey.exe does not work unless the Desktop mode is already active, and EnableUIAccess.ahk solves the problem. Running the script as admin does not solve the problem.