Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm working with Synergy (GUI), and I'm trying to create volume keys that change the volume of one computer regardless of which screen is currently active. I have two screens, let's call them A and B. To keep it simple, I will only refer to the volume up hotkey, as adding volume down and volume mute should be simple if I can figure one of them out.

If I press F12 on either A or B, I want the volume to increase on B.

I've tried several setups:

1)

On keystroke(F12):
   Switch to Screen B
   Send key VolumeUp

2)

On keystroke(F12):
   Switch to Screen B
   Send key F12

AHK Script defines F12 as hotkey VolumeUp On B

3)

Both of the above
Switch to Screen A

None of these have given me the functionality that I'm looking for. Often, the volume doesn't change, and neither does the screen. In fact, setting these up has, on occasion, caused the AHK script to not work. My absolute preferred functionality would be:

On keystroke(F12):
  Determine which screen is currently active
  Make Screen B active if it isn't already
  Increase the system volume
  Return to the previously active screen

Anyone have any pointers on how to make this work?

==Edit, more info == AHK Script:

F11::Send {Volume_Down 3} ; Lower the master volume by 3 interval (typically 5%)
Return

F12::Send {Volume_Up 3}  
Return

F10::Send {Volume_Mute} ; Mutes The system Volume
Return

Again, note that this script works great locally.

Synergy Config:

section: screens
balthazar:
    halfDuplexCapsLock = false
    halfDuplexNumLock = false
    halfDuplexScrollLock = false
    xtestIsXineramaUnaware = false
    switchCorners = none 
    switchCornerSize = 0
midnight:
    halfDuplexCapsLock = false
    halfDuplexNumLock = false
    halfDuplexScrollLock = false
    xtestIsXineramaUnaware = false
    switchCorners = none 
    switchCornerSize = 0
end

section: aliases
end

section: links
balthazar:
    right = midnight
midnight:
    left = balthazar
end

section: options
relativeMouseMoves = false
screenSaverSync = true
win32KeepForeground = false
switchDelay = 10
switchCorners = none 
switchCornerSize = 0
keystroke(F11) = switchToScreen(midnight), keyDown(F11,midnight) ; keyUp(F11,midnight)
keystroke(F12) = switchToScreen(midnight), keyDown(F12,midnight) ; keyUp(F12,midnight)
keystroke(F10) = switchToScreen(midnight), keyDown(F10,midnight) ; keyUp(F10,midnight)
end

As you can see, I've been poking around with the hotkeys. I was pretty sure that this would work, but it isn't :(

==EDIT, more info ==

Ok, based on some IRC chatting that I've been doing, I've decided to approach it this way: Clients will individually have to translate whatever key they want into AudioUp, and Synergy will push all AudioUp commands to midnight. Synergy's hotkey now looks like this:

keystroke(AudioUp) = keystroke(AudioUp,midnight)

Then, I have AHK still set up with:

F12::Send {Volume_Up 3}

And I was hoping that would do it. But it didn't. I'm going to investigate if AHK is the culprit here (maybe Volume_Up != AudioUp)

share|improve this question
    
does behavior change if you add #InstallKeybdHook to the top of your file? –  yhw42 Feb 29 '12 at 5:46
    
It did not...However, I opened my AHK log, and when pressing the hotkeys with A in focus, AHK claims to be sending Volume_Up 3, but B's volume doesn't increase. –  Cody S Feb 29 '12 at 17:26
    
My guess is that the keyboard hooks for Synergy and AHK are competing for keystrokes and not sharing with each other. Is there a Synergy console to see what keystrokes Synergy sees? –  yhw42 Feb 29 '12 at 21:28
    
Negatory on the console –  Cody S Feb 29 '12 at 21:32

1 Answer 1

I just wanted to say that I managed to get this working using basically what you said your second try was.

You probably were having a conflict with AHK and Synergy because this worked for me:

When I press the volume down/up play/pause on my main computer, I want it to effect my other PC (the one that is playing my music)

    keystroke(AudioDown,PC1) = keystroke(AudioDown,PC2)
    keystroke(AudioUp,PC1) = keystroke(AudioUp,PC2)
    keystroke(AudioNext,PC1) = keystroke(AudioNext,PC2)
    keystroke(AudioPrev,PC1) = keystroke(AudioPrev,PC2)

My advice is to save your configuration file and then open up the one you saved and edit it.

Here is my complete config file:

section: screens
PC1:
    halfDuplexCapsLock = false
    halfDuplexNumLock = false
    halfDuplexScrollLock = false
    xtestIsXineramaUnaware = false
    switchCorners = none 
    switchCornerSize = 0
PC2:
    halfDuplexCapsLock = false
    halfDuplexNumLock = false
    halfDuplexScrollLock = false
    xtestIsXineramaUnaware = false
    switchCorners = none 
    switchCornerSize = 0
end

section: aliases
end

section: links
PC1:
    right = PC2
PC2:
    left = PC1
end

section: options
    keystroke(AudioDown,PC1) = keystroke(AudioDown,PC2)
    keystroke(AudioUp,PC1) = keystroke(AudioUp,PC2)
    keystroke(AudioNext,PC1) = keystroke(AudioNext,PC2)
    keystroke(AudioPrev,PC1) = keystroke(AudioPrev,PC2)
    relativeMouseMoves = false
    screenSaverSync = true
    win32KeepForeground = false
    switchCorners = none 
    switchCornerSize = 0
 end
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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