#1
@Komatsubara
"SDR Oxide - Browan : Direct frequency input"
Enter the frequency directly using the number keys on the keyboard.
** I am using this code as is.
This is a Sample code :
#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
;**********************************************************************************
; No support is provided; please use at your own risk.
;
; AutoHotKey version 1.1 : https://www.autohotkey.com/
; Give this file an appropriate name (ensure the file extension is ".ahk").
; Copy it into the same folder as the SDROxide executable file.
; Double-click this file to begin operation.
; It will launch SDROxide only if it is not already running.
; If SDROxide fails to launch, please start it manually.
; This configuration applies only to the number keys.
; You must remove the shortcuts assigned to the number keys that were originally built into the SDROxide software itself.
; If the coordinates for the frequency display area change, you will need to update the coordinate values in the code.
; After entering a number, press the Enter key to finalize the input.
; Please provide input in units of "kHz"; the software will automatically convert it to "MHz" internally.
; It is convenient to create a shortcut on your PC screen.
;
; https://radio.chobi.net/DX/
; Hiroyuki Komatsubara @ NOW ON THE RADIO DX
;**********************************************************************************
IfWinNotExist, ahk_exe sdroxide.exe
{
IfWinNotExist, SDROxide
{
Run, %A_ScriptDir%\sdroxide.exe
WinWait, ahk_exe sdroxide.exe,, 5
}
}
global freqBuffer := ""
#IfWinActive ahk_exe sdroxide.exe
~0:: AddDigit("0")
~1:: AddDigit("1")
~2:: AddDigit("2")
~3:: AddDigit("3")
~4:: AddDigit("4")
~5:: AddDigit("5")
~6:: AddDigit("6")
~7:: AddDigit("7")
~8:: AddDigit("8")
~9:: AddDigit("9")
Numpad0:: AddDigit("0")
Numpad1:: AddDigit("1")
Numpad2:: AddDigit("2")
Numpad3:: AddDigit("3")
Numpad4:: AddDigit("4")
Numpad5:: AddDigit("5")
Numpad6:: AddDigit("6")
Numpad7:: AddDigit("7")
Numpad8:: AddDigit("8")
Numpad9:: AddDigit("9")
AddDigit(digit) {
global freqBuffer
freqBuffer .= digit
ToolTip, Tuning: %freqBuffer% kHz
}
Backspace::
if (StrLen(freqBuffer) > 0) {
StringTrimRight, freqBuffer, freqBuffer, 1
if (freqBuffer = "")
ToolTip
else
ToolTip, Tuning: %freqBuffer% kHz
}
return
Escape::
freqBuffer := ""
ToolTip
return
Enter::
NumpadEnter::
ApplyFrequency()
return
ApplyFrequency() {
global freqBuffer
if (freqBuffer = "") {
Send, {Enter}
return
}
targetkHz := freqBuffer
targetMHz := SubStr(Format("{:.6f}", targetkHz / 1000), 1, 10)
targetMHz := RTrim(RTrim(targetMHz, "0"), ".")
Click, 200, 100, 2
Sleep, 200
Send, ^a
Sleep, 50
Send, {BS}
Sleep, 50
Send, %targetMHz%
Sleep, 100
Send, {Enter}
freqBuffer := ""
ToolTip, Tuned: %targetkHz% kHz (%targetMHz% MHz)
SetTimer, RemoveToolTip, -2000
}
RemoveToolTip:
ToolTip
return
#IfWinActive