I've got this so far, which works fairly well by toggling the Mic input mute status, so the player has to mute it manually in the Soundcard control panel first and then the script toggles it to unmute whilst the keys are held.
In this example:
Insert is the Teamspeak 3 PTT key.
End is the Task Force Arrowhead Radio (ArmA3 addon) Short Range transmit key.
Ctrl+End is the TFAR Long Range transmit key.
Alt+End is the TFAR underwater transceiver transmit key.
It works fairly well except
a) it seems to send some keys twice, so for example when I press Ctrl+Xbutton2 to send Ctrl+End, the radio works fine but it triggers the ArmA3 command Lower Weapon, which I have mapped to 2xCtrl.
b) I have to be sure to release Xbutton2 first or else it will leave the keys depressed and the radio stuck on transmit. It's most natural to release the most button first when holding a modifier key and pressing it but still it would be better if the script released the keys when either Xbutton2 or the modifier key was released.
c) When setting the keys in TS3, I have to press Xbutton2 first, then Ctrl, then release either key. If I press Ctrl first, then Xbutton2 the keys register but if I release Xbutton2 first it will just reset and prompt for input again and if I release Ctrl first it will just set Ctrl as the Hotkey. It would be nice if this worked more naturally i.e. press Ctrl+Xbutton2 then release both, in any order, to set.
So if anyone has any ideas how to fix any of those, that would be great.
Code: Select all
#Persistent ; Keep this script running until the user explicitly exits it.
Xbutton1::
VA_SetMasterMute(!VA_GetMasterMute("capture"), "capture")
Send, {Insert down}
Keywait, Xbutton1
Send, {Insert up}
VA_SetMasterMute(!VA_GetMasterMute("capture"), "capture")
return
Xbutton2::
VA_SetMasterMute(!VA_GetMasterMute("capture"), "capture")
Send, {End down}
Keywait, XButton2
Send, {End up}
VA_SetMasterMute(!VA_GetMasterMute("capture"), "capture")
return
^Xbutton2::
VA_SetMasterMute(!VA_GetMasterMute("capture"), "capture")
Send, {Ctrl down} {End down}
Keywait, XButton2
Send, {Ctrl up} {End up}
VA_SetMasterMute(!VA_GetMasterMute("capture"), "capture")
return
!Xbutton2::
VA_SetMasterMute(!VA_GetMasterMute("capture"), "capture")
Send, {Alt down} {End down}
Keywait, XButton2
Send, {Alt up} {End up}
VA_SetMasterMute(!VA_GetMasterMute("capture"), "capture")
return