我正在使用 Synergy (GUI),并尝试创建音量键,无论当前哪个屏幕处于活动状态,都可以更改一台计算机的音量。我有两个屏幕,我们称之为 A 和 B。为了简单起见,我将仅引用音量调高热键,因为如果我能找出其中一个,添加音量调低和音量静音应该很简单。
如果我在 A 或 B 上按下 F12,我希望 B 上的音量增加。
我尝试过几种设置:
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
这些都没有给我带来我想要的功能。通常,音量不会改变,屏幕也不会改变。事实上,设置这些有时会导致 AHK 脚本不起作用。我绝对喜欢的功能是:
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
有人能指点一下如何让它工作吗?
==编辑,更多信息== AHK 脚本:
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
再次注意,该脚本在本地运行良好。
协同配置:
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
如您所见,我一直在尝试使用热键。我非常确定这会起作用,但事实并非如此 :(
==编辑,更多信息==
好的,根据我进行的一些 IRC 聊天,我决定采用以下方法:客户端必须单独将他们想要的任何键翻译成 AudioUp,而 Synergy 会将所有 AudioUp 命令推迟到午夜。Synergy 的热键现在如下所示:
keystroke(AudioUp) = keystroke(AudioUp,midnight)
然后,我仍然设置 AHK:
F12::Send {Volume_Up 3}
我希望这样能解决问题。但没用。我要调查一下 AHK 是否是罪魁祸首(可能是 Volume_Up != AudioUp)
答案1
我只是想说,我基本上按照你第二次尝试的方法成功地完成了这项工作。
您可能与 AHK 和 Synergy 存在冲突,因为这对我有用:
当我按下主计算机上的音量减小/增大播放/暂停键时,我希望它能够影响我的另一台电脑(正在播放音乐的电脑)
keystroke(AudioDown,PC1) = keystroke(AudioDown,PC2)
keystroke(AudioUp,PC1) = keystroke(AudioUp,PC2)
keystroke(AudioNext,PC1) = keystroke(AudioNext,PC2)
keystroke(AudioPrev,PC1) = keystroke(AudioPrev,PC2)
我的建议是保存您的配置文件,然后打开您保存的文件并进行编辑。
这是我的完整配置文件:
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