Jump to content

Recommended Posts

Hi, all,

 

I'm using ShadowPlay to record because it takes up the least amount of CPU while running (I've messed around with OBS Studio and while it does a good job, it causes an 8-15 FPS drop).

 

I've figured out how to use AutoHotkey to get multiple PTT keys going for Shadowplay, and am using the following code (<Numpad /> is my ShadowPlay PTT):

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

~XButton2::
{
	Send, {NumpadDiv down}
	Return
}
~XButton2 up::
{
	Send, {NumpadDiv up}
	Return
}

~CapsLock::
{
	SetCapsLockState, on
	Send, {NumpadDiv down}
	Return
}
~CapsLock up::
{
	SetCapsLockState, off
	Send, {NumpadDiv up}
	Return
}

This allows me to turn PTT through ShadowPlay with MouseButton5 (my TS3 key) and CapsLock (my ACRE radio key).

Issue is, when I hold CapsLock, it acts like holding down a key while typing (https://i.gyazo.com/474f97bf68ab5ee4f7ac7d7bdbf26bbf.gif)

In-game, I just hear the radio button sound 20x/sec and I can't actually effectively transmit a message.

 

Does anyone have any idea how I can make it so that CapsLock doesn't freak out when I press it?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

I know this thread isnt that new, but I had a similar issue myself back in the day with DXTory and recording multiple PTT keys. I adapted the way I use it to your script and you can try that and see if it works for you. It will most likely work and it will remove the ddddd issue you show in your gif.

 

; Record Push to Talk.

$XButton2::

SetKeyDelay 100
Send, {NumpadDiv down}

;Sleep 100
Send, {XButton2 down}

KeyWait XButton2

Send, {NumpadDiv up}

;Sleep 100
Send, {XButton2 up}

Return

 

; Recording Push to Talk via ACRE.
$CapsLock::
SetKeyDelay 100
SetCapsLockState, on
Send, {NumpadDiv down}

;Sleep 100
Send, {CapsLock down}
KeyWait CapsLock
Send, {NumpadDiv up}

;Sleep 100
Send, {CapsLock up}
SetCapsLockState, off
Return

 

Both Sleep times are disabled, but turning them on might be an idea if you at times have issues with hotmicing because one of the buttons didnt trigger up or down correctly. You also do not need the #NoEnv SendMode Input SetWorkingDir %A_ScriptDir% stuff with this above.

 

Bonus tip I put in all my control overlay scripts:

 

; Script on/off.
$PrintScreen::
Suspend,Toggle
SoundPlay, %A_WinDir%\Media\Speech On.wav
return

  • Like 1

Share this post


Link to post
Share on other sites

You know what. Since I got a Rode NT-USB mic a few days ago. I am also going to add my other "help" scripts here that might help people out in Arma if they get similar setups, aka Using a Desktop mic with speakers rather than headphones. (Direct copy/paste from my "backup" .ahk files and just simple explanations and a few copy/past and adapt examples)

 

How to lower speaker volume while you use a Push To Talk Key.

 

; Script on/off.
$PrintScreen::
Suspend,Toggle
SoundPlay, %A_WinDir%\Media\Speech On.wav
return

 

; While Push To Talk is held down: Lower or Mute Windows speaker sound volume.
; (Balance sleep times if people can hear speakers at the start or end.)
; (Default can be high as 700ms on bad mics or as low as 200 (Mute) and 100 (Lower Volume).)
; (Røde NT-USB needs 200 on Mute and 100 on Lower Volume.)
; (Koss SB45 needs 700 on both.)
; (Point is: Mic quality matters. PgDn = Key you press. F11 = Actual PTT setting.)

 

; Mute:

; (Note: Shadowplay ingame sound is also affected)
;$PgDn::
SetKeyDelay 50
Send {Volume_Mute}    
Sleep 200
Send, {F11 Down}    
KeyWait PgDn
Send, {F11 Up}
Sleep 200
Send {Volume_Mute}
return

 

; Lower Volume.
; (Note: Use this for Shadowplay to keep some level of ingame sound)
;~PgDn::
;$PgDn::
SetKeyDelay 50
SoundSet, 30        ; Is in % of 100.
Sleep 100
Send, {F11 Down}    
KeyWait PgDn
Send, {F11 Up}
Sleep 100
SoundSet, 100        ; Is in % of 100.
return

 

; Lower Volume on Ingame PTT binding.
; (~ allows the ingame binding to still work)
~PgDn::
SoundSet, 30
KeyWait PgDn
SoundSet, 100
return

 

;~Numpad7::
SoundSet, 30
KeyWait Numpad7
SoundSet, 100
return

 

; Lower Volume on Ingame PTT binding.
; While also pressing Shadowplay recording PTT.
;~PgDn::
SetKeyDelay 50
SoundSet, 30
Send, {F11 Down}    
KeyWait PgDn
Send, {F11 Up}
SoundSet, 100
return

 

How to toggle mute any Microphone you have installed on your system.

 

; Script on/off.
$PrintScreen::
Suspend,Toggle
SoundPlay, %A_WinDir%\Media\Speech Off.wav
return

 

; Microphone Mute Toggle:
; In order to get the right Mixer channel (Which is 14 in this script) for your device.
; You need to run the SoundCardAnalyzer.ahk script first and then find the mixer nr for it.
; SoundCardAnalyzer (copy paste) found at bottom of page:

; https://autohotkey.com/docs/commands/SoundSet.htm
; What you need at min to change in this script is therefor Master:1 and 14 to the correct ones.

 

; Tip:
; USB mics show up as their own Component Type, aka Master:1 in this script.
; Only the jack version show up as "microphone".


; A decent way to find out which it is. Is set the mic level to 20 or something abnormally low.
; Find that number in Setting and then set it to a higher number

; and run the SoundCardAnalyzer script again
; to check if its the one via the number changing to the new level set.

 

; Windows Sounds you can use if you have not made your own:
; SoundPlay, %A_WinDir%\Media\Speech On.wav
; SoundPlay, %A_WinDir%\Media\Speech Off.wav

 

; AHK Command Syntex:
; SoundGet, NewSetting, ComponentType, ControlType, DeviceNumber
; SoundSet, NewSetting, ComponentType, ControlType, DeviceNumber

 

; Mic Mute Toggle.
$CapsLock::
SoundGet, isMute , MASTER:1, MUTE, 14
If isMute = Off
    {
    SoundSet, 1 , MASTER:1, MUTE, 14
    SoundPlay, %A_WinDir%\Media\MIC_OFF.wav
    SetCapsLockState, On
    }
else
    {
    SoundSet, 0 , MASTER:1, MUTE, 14
    SoundPlay, %A_WinDir%\Media\MIC_ON.wav
    SetCapsLockState, Off
    }
return

 

; Mic Off.
$q::
SoundSet, 1 , MASTER:1, MUTE, 14
SoundPlay, %A_WinDir%\Media\MIC_OFF.wav
return

 

; Mic On.
$e::
SoundSet, 0 , MASTER:1, MUTE, 14
SoundPlay, %A_WinDir%\Media\MIC_ON.wav
return

 

 

Nothing really advanced, but it is still better to find than figuring everything out for yourself once one get that issue. LoL :f:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×