PerseusKeyboard XYZ 2026/11/01(Sun) 17:12 No.1561 PerseusKeyboard
ちょっと刺激されて、私も作っちゃいました。 ・・・といっても原作からの改造版です。
打ち込んだ周波数の数字がすべてバッファされる仕組みです。 瞬間的にしかテストをしていないのですがって、公開しても大丈夫かな? w
・数値がバッファされますので、エンターキーを押すまでダイヤログは出ません。
弄くってみたい方用に参考で上げておきますが、作者はあくまでも原作者にあります。 https://gist.github.com/f6fvy/adf5997d8e78922ca2563d9d795161b0
※以下全部をコピペして、●▼■ホニャラカ,ahk (ファイル名は何でもいいですが、拡張子が大事w)。 で、perseusの実行ファイルのあるフォルダーに入れておしまいです。 これをダブルクリックでPerseusが立ち上がって操作できるようになります。 ※Windows7 ~ 11 で動くと思うのですが、AutoHotKey は以前のバージョン1.0台を使います。(たぶん、2以上では動きません。) これは私の方ではサポートしませんので後はよろしくお願いします。
;*************************************************************************************** ; *****My setting: [Wheel Step]-->100Hz, [CF Step]-->5kHz, Windows7-11 / 64bits ; ; Help: ; Right arrow => Frquency up (CF Step) / mouseWheel up ; Left arrow => Frquency down (CF Step) / mouseWheel down ; PageDown => 10 notches of the mouseWheel up ; Delet => 10 notches of the mouseWheel down ; Up arrow => Frquency up (Wheel Step) ; Down arrow => Frquency down (Wheel Step) ; Home => Decrease "wheel step" ***cancel ; PageUp => Increase "wheel step" ***cancel ; ; [ => Decrease "CF STEP" ; ] => Increase "CF STEP" ; Home => Toggle Zoom the frequency in waterfall ; / => Decrease "Ref Lev (dBm)" ; * => Increase "Ref Lev (dBm)" ; Enter => Opens the "Frequency (KHz) dialog for input, then close the keypad (with another Enter) ; 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 => Input frequency directly (Buffered & Batch sent on Enter/k/m) ; a, s, c, r, l, u, f, d, e => Activate Modes: AM, SAM, CW, RTTY, LSB, USB, FM, DRM, usEr ; +, - (from Numpad) => Activate "USB" and "LSB" (as "u" and "l", but more quickly) ; - => Tuning up fm value of CF Step ; _ => Tuning up fm value of CF Step ; w => switch to waterfall ; t => switch to spectrum ; x => Center frequency in spectrum or waterfall ; b => Toggle Noise Blanker ON/OFF ; n, End => Toggle Noise Reducer ON/OFF ; j => Toggle "SpkRej" on off ; h => Activate Notch (to deactivate use "y" PBT) ; y => Activate PBT (to deactivate use "h" Notch and so on) ; g => Activate Autonotch ; m => 1. Mute or Activate Volume (If no digits typed) / 2. input as "MHz" (If digits typed) ; k => 1. CWPeak (If no digits typed) / 2. input as "kHz" (If digits typed) ; z => Wave Files change ; Shift q, ALT-F4 => Close Perseus and also the script ; Tab => Jump forwards in the PLAYBACK bar by the specified number of seconds ; Shift+Tab => Jump backwards in the PLAYBACK bar by the specified number of seconds ; Ctrl+Tab => A dialog will appear where the PLAYBACK jump step and the WAV file length can be changed
; (C) Laurent Haas - F6FVY - Nov 2008 (f6fvy _at_ free.fr) ; modified by Aldo Moroni (IW2DZX) and Salvo Micciche' (SWL IT9-4639) ; modified by WoodBoxRadio (IK3VIG) ; extended by Ferdinand Lenhardt (perseus_only) ; Thanks to Wolfgang OE1MWW for some important tips ;*************************************************************************************************
#SingleInstance force ; skips the dialog box and replaces a previous instance of this script automatically #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetDefaultMouseSpeed, 0 ; Move the mouse instantly.
SetTitleMatchMode RegEx
;--- 入力バッファ管理用の変数 --- Global FreqBuffer := ""
;*** BEGIN of the PLAYBACK parameter section *** playback_step = 10 ; seconds playback_minutes = 5 playback_seconds = 0
playback_bar_start = 180 playback_bar_end = 1011 playback_bar_vpos = 603
playback_position := playback_bar_start playback_last_timestamp = 0
PlaybackJump(seconds) { global return (playback_bar_end - playback_bar_start) / (((playback_minutes * 60) + playback_seconds) / seconds) } ;*** END of the PLAYBACK parameter section ***
;--- バッファに溜まった数字を「一括」でPerseusのウィンドウに高速送信する関数 --- sendBufferToFreqWnd(unitKey:="") { If (FreqBuffer = "") { Click,,100,245,2 WinWait,ahk_class#32770,, 2 if ErrorLevel return IfWinNotActive,ahk_class#32770 WinActivate Click,,110,45 Send {Space}{BS} return }
CoordMode, Mouse, Screen MouseGetPos, cxpos, cypos CoordMode, Mouse, Relative
Click,,100,245,2 WinWait, ahk_class#32770,, 2 if ErrorLevel { FreqBuffer := "" return } ControlFocus, Edit1, ahk_class#32770 ControlClick, Edit1, ahk_class#32770, LEFT IfWinNotActive, ahk_class#32770 WinActivate Click,,110,45 SendRaw %FreqBuffer% FreqBuffer := "" if (unitKey = "k" || unitKey = "Enter") { Click,,64,184 Click,,104,186 } else if (unitKey = "m") { Click,,33,184 Click,,104,186 } CoordMode, Mouse, Screen Click,,%cxpos%,%cypos%,0 CoordMode, Mouse, Relative return }
;function for background mouse operation with recovery of the mouse cursor position UnnoticeableClick(xpos,ypos,attr="",clicks=1) { CoordMode,Mouse,Screen MouseGetPos,cxpos,cypos CoordMode,Mouse,Relative Click,%attr%,%xpos%,%ypos%,%clicks% CoordMode,Mouse,Screen Click,,%cxpos%,%cypos%,0 return }
; Activate Perseus if it isn't already active (with "realtime" priority) IfWinExist Perseus ahk_class (Afx:400000:2028:|Afx:00400000:2028:) { WinActivate } else { Run Perseus,,UseErrorLevel,NewPID if ErrorLevel = ERROR { MsgBox Can't find the Perseus program.`n`nCheck PerseusKeyboard and the Perseus software`nare located in the same directory. ExitApp } Process,Priority,%NewPID%,Realtime WinWait Perseus ahk_class (Afx:400000:2028:|Afx:00400000:2028:) WinActivate }
#IfWinActive Perseus ahk_class (Afx:400000:2028:|Afx:00400000:2028:) {
;*** Frequency Control *** Left::Click,,192,309 Right::Click,,987,308 Up::Click,WD,587,290 Down::Click,WU,587,290
PgDn:: Loop 10 { UnnoticeableClick(587,290,"WD") Sleep 1 } return
Delete:: Loop 10 { UnnoticeableClick(587,290,"WU") Sleep 1 } return
[::UnnoticeableClick(135,295) ]::UnnoticeableClick(150,295) -::UnnoticeableClick(130,333) _::UnnoticeableClick(155,334) /:: NumpadDiv::UnnoticeableClick(133,152,"ARROWD") *:: NumpadMult::UnnoticeableClick(157,152,"ARROWU") t:: +t::UnnoticeableClick(227,309) w:: +w::UnnoticeableClick(263,309) b:: +b::UnnoticeableClick(518,403) End:: n:: +n::UnnoticeableClick(969,402)
;--- 数字キーのバッファリング処理 --- 0:: Numpad0::FreqBuffer .= "0" 1:: Numpad1::FreqBuffer .= "1" 2:: Numpad2::FreqBuffer .= "2" 3:: Numpad3::FreqBuffer .= "3" 4:: Numpad4::FreqBuffer .= "4" 5:: Numpad5::FreqBuffer .= "5" 6:: Numpad6::FreqBuffer .= "6" 7:: Numpad7::FreqBuffer .= "7" 8:: Numpad8::FreqBuffer .= "8" 9:: Numpad9::FreqBuffer .= "9"
;--- 確定処理 --- Enter:: NumpadEnter::sendBufferToFreqWnd("Enter")
m:: +m:: if (FreqBuffer != "") { sendBufferToFreqWnd("m") } else { UnnoticeableClick(1002,405) } return
k:: +k:: if (FreqBuffer != "") { sendBufferToFreqWnd("k") } else { UnnoticeableClick(380,546) } return
;*** モード選択やその他のキー *** l:: +L:: NumPadSub::UnnoticeableClick(408,353) u:: +U:: NumPadAdd::UnnoticeableClick(455,353) a:: +A::UnnoticeableClick(204,353) s:: +S::UnnoticeableClick(259,353) +c:: C::UnnoticeableClick(310,353) r:: +R::UnnoticeableClick(362,353) f:: +F::UnnoticeableClick(508,353) d:: +D::UnnoticeableClick(561,353) e:: +E::UnnoticeableClick(594,353) j:: +j::UnnoticeableClick(562,458) y:: +y::UnnoticeableClick(260,546) h:: +h::UnnoticeableClick(300,546) g:: +g::UnnoticeableClick(340,546) x:: +x::UnnoticeableClick(23,422) Home::UnnoticeableClick(300,310)
;Wave file change z:: +z:: UnnoticeableClick(playback_bar_end,playback_bar_vpos) playback_position := playback_bar_start playback_last_timestamp := A_TickCount Sleep, 1000 return
;*** PLAYBACK hotkey section *** Tab:: playback_current_timestamp := A_TickCount if(playback_last_timestamp = 0 or playback_last_timestamp > playback_current_timestamp) playback_last_timestamp := playback_current_timestamp playback_position += PlaybackJump((playback_current_timestamp - playback_last_timestamp) / 1000) playback_last_timestamp := playback_current_timestamp if(playback_position > (playback_bar_end - 1)) playback_position := playback_bar_start + mod(playback_position - playback_bar_start, playback_bar_end - playback_bar_start) playback_position += PlaybackJump(playback_step) if(playback_position > (playback_bar_end - 1)) playback_position := playback_bar_start UnnoticeableClick(playback_position,playback_bar_vpos) Sleep, 100 return
+Tab:: playback_current_timestamp := A_TickCount if(playback_last_timestamp = 0 or playback_last_timestamp > playback_current_timestamp) playback_last_timestamp := playback_current_timestamp playback_position += PlaybackJump((playback_current_timestamp - playback_last_timestamp) / 1000) playback_last_timestamp := playback_current_timestamp if(playback_position > (playback_bar_end - 1)) playback_position := playback_bar_start + mod(playback_position - playback_bar_start, playback_bar_end - playback_bar_start) if(playback_position > (playback_bar_start + PlaybackJump(1))) { playback_position -= PlaybackJump(playback_step) if(playback_position < playback_bar_start) playback_position := playback_bar_start UnnoticeableClick(playback_position,playback_bar_vpos) } Sleep, 100 return
;--- PLAYBACK設定ダイアログ処理 --- ^Tab:: InputBox,playback_step_tmp,PLAYBACK,Step (in seconds),,160,130,,,,,%playback_step% if (ErrorLevel) return
if playback_step_tmp is not digit { MsgBox,0x10,Error,Step invalid return } if (playback_step_tmp <= 0) { MsgBox,0x10,Error,Step invalid return } playback_step := playback_step_tmp
InputBox,playback_minutes_tmp,PLAYBACK,Minutes,,160,130,,,,,%playback_minutes% if (ErrorLevel) return
if playback_minutes_tmp is not digit { MsgBox,0x10,Error,Minutes invalid return } if (playback_minutes_tmp < 0 or playback_minutes_tmp > 59) { MsgBox,0x10,Error,Minutes invalid return } playback_minutes := playback_minutes_tmp
InputBox,playback_seconds_tmp,PLAYBACK,Seconds,,160,130,,,,,%playback_seconds% if (ErrorLevel) return
if playback_seconds_tmp is not digit { MsgBox,0x10,Error,Seconds invalid return } if (playback_seconds_tmp < 0 or playback_seconds_tmp > 59) { MsgBox,0x10,Error,Seconds invalid return } playback_seconds := playback_seconds_tmp return
;Close Perseus and the script +q:: !F4:: UnnoticeableClick(1010,12) ExitApp return
;--- 互換性維持用の処理 --- #IfWinActive Frequency ahk_class#32770 Enter:: NumpadEnter:: k:: +k:: click,,64,184 click,,104,186 return m:: +m:: click,,33,184 click,,104,186 return }
|