EDITED SCRIPTS! Activate your PTT with a mouse click or key stroke
Posted: Thu May 19, 2022 5:54 pm
I've edited my scripts to return focus back to my previous active window
Hi,
I was frustatated for having to click on Thetis to recover my "space bar" PTT when focus was in another Window in my screen (for example when typing callsigns in my log book).
After 2 days of search I've found a solution and now I can use a key stroke or a click in my mouse to get focus on Thetis, automatically start transmiting and set focus back to my previous window.
1) Download and install AutoHotKey: https://www.autohotkey.com/
2) Right click on your desktop, select "new" and create 2 new AHK scripts (one for your keyboard and one for your mouse)
3) For your keyboard script copy and paste the following lines:
f12:: ; Sets the key that you will use for PTT (I use f12 but you can assign any other key)
{
ActWin := WinActive("A") WinActivate, ahk_id %ActWin% ; Detects active window
WinActivate, ahk_exe Thetis.exe ; Sets focus to Thetis
SendInput, {SPACE} ; Sends (space bar) to Thetis to activate/release PTT
Sleep 200 ; Waits x miliseconds before setting focus back to previous window (if you want you can delete this line)
WinActivate, ahk_id %ActWin% ; Returns focus to previous active window
}
return
4) For your mouse's script copy and paste the following lines into the second blank script you created:
XButton1:: ; Detects the click on your 4th mouse button
{
ActWin := WinActive("A") WinActivate, ahk_id %ActWin% ; Detects active window
WinActivate, ahk_exe Thetis.exe ; Sets focus to Thetis
SendInput, {SPACE} ; Sends (space bar) to Thetis to activate/release PTT
Sleep 200 ; Waits x miliseconds before setting focus back to previous window (if you want you can delete this line)
WinActivate, ahk_id %ActWin% ; Returns focus to previous active window
}
return
You can use other mouse buttons, just change it in first line of the script:
LButton (left button)
RButton (Right button)
MButton (Middle or wheel mouse button)
XButton1 (4th mouse button)
XButton2 (5th mouse button)
5) Save your scripts and make a shortcut for each
6) To launch the scripts at Windows startup, move both shortcuts to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
7) Restart Windows
If you don't want to run your scripts automatically on startup skip step 6, right click on the script and select "run script" to launch it when you want.
EDIT: If you run Thetis as administrator you must also run script as administrator
That's it!
Now you can use a key stroke or a single mouse click to transmit from anywhere in your windows.
Hope it helps someone!
73
Jordi
EA3CL
Hi,
I was frustatated for having to click on Thetis to recover my "space bar" PTT when focus was in another Window in my screen (for example when typing callsigns in my log book).
After 2 days of search I've found a solution and now I can use a key stroke or a click in my mouse to get focus on Thetis, automatically start transmiting and set focus back to my previous window.
1) Download and install AutoHotKey: https://www.autohotkey.com/
2) Right click on your desktop, select "new" and create 2 new AHK scripts (one for your keyboard and one for your mouse)
3) For your keyboard script copy and paste the following lines:
f12:: ; Sets the key that you will use for PTT (I use f12 but you can assign any other key)
{
ActWin := WinActive("A") WinActivate, ahk_id %ActWin% ; Detects active window
WinActivate, ahk_exe Thetis.exe ; Sets focus to Thetis
SendInput, {SPACE} ; Sends (space bar) to Thetis to activate/release PTT
Sleep 200 ; Waits x miliseconds before setting focus back to previous window (if you want you can delete this line)
WinActivate, ahk_id %ActWin% ; Returns focus to previous active window
}
return
4) For your mouse's script copy and paste the following lines into the second blank script you created:
XButton1:: ; Detects the click on your 4th mouse button
{
ActWin := WinActive("A") WinActivate, ahk_id %ActWin% ; Detects active window
WinActivate, ahk_exe Thetis.exe ; Sets focus to Thetis
SendInput, {SPACE} ; Sends (space bar) to Thetis to activate/release PTT
Sleep 200 ; Waits x miliseconds before setting focus back to previous window (if you want you can delete this line)
WinActivate, ahk_id %ActWin% ; Returns focus to previous active window
}
return
You can use other mouse buttons, just change it in first line of the script:
LButton (left button)
RButton (Right button)
MButton (Middle or wheel mouse button)
XButton1 (4th mouse button)
XButton2 (5th mouse button)
5) Save your scripts and make a shortcut for each
6) To launch the scripts at Windows startup, move both shortcuts to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
7) Restart Windows
If you don't want to run your scripts automatically on startup skip step 6, right click on the script and select "run script" to launch it when you want.
EDIT: If you run Thetis as administrator you must also run script as administrator
That's it!
Now you can use a key stroke or a single mouse click to transmit from anywhere in your windows.
Hope it helps someone!
73
Jordi
EA3CL