Autohotkey 自动热键-如何使用上下箭头键导航收音机列表?
我有以下脚本。我不确定如何使用向上或向下箭头键修改它以导航结果。要运行它,只需创建一个.txt文件并在其中添加一些单词(每行一个单词),然后编辑.txt文件所在的文件路径。然后只需搜索在至少两行中找到的关键字。e、 gAutohotkey 自动热键-如何使用上下箭头键导航收音机列表?,autohotkey,Autohotkey,我有以下脚本。我不确定如何使用向上或向下箭头键修改它以导航结果。要运行它,只需创建一个.txt文件并在其中添加一些单词(每行一个单词),然后编辑.txt文件所在的文件路径。然后只需搜索在至少两行中找到的关键字。e、 g Word1 Word2 如果您搜索word,它将返回word1和word2。然后我只需要使用上下箭头键在它们之间进行选择 F9:: { FilePath := "D:\5. Programs\AutoHotkey L x64\test.txt"
Word1
Word2
如果您搜索word,它将返回word1和word2。然后我只需要使用上下箭头键在它们之间进行选择
F9::
{
FilePath := "D:\5. Programs\AutoHotkey L x64\test.txt"
Gui, Destroy
Gui, Font, S20
Gui, Add, Text, X25 Y10 W450 H30 +Center , Search Box
Gui, Font, S10
Gui, Add, Edit, XP Y+20 W450 H20 vSearchString,
Gui, Color
Gui, Show, W500 H100, Search Box
return
#IfWinActive, Search Box
{
Enter::
Gui, Submit, NoHide
ResultList := []
ChosenString := ""
Loop, Read, %FilePath%
{
if (InStr(A_LoopReadLine, SearchString))
{
ResultList.Push(A_LoopReadLine)
}
}
if (!ResultList.Length())
{
;MsgBox % "No match found!"
return
}
Gui, DisplayResults:New,-MaximizeBox -MinimizeBox , Search results
Gui, Add, Text, w250, % "Click on one of the results below:"
for key, value in ResultList
{
if (key = 1)
Gui, Add, Radio, gSelectResult vChosenString, %value%
else
Gui, Add, Radio, gSelectResult, %value%
}
Gui, DisplayResults:Show
return
SelectResult:
Gui, DisplayResults:Submit
;Msgbox, % ResultList[ChosenString]
Clipboard := % ResultList[ChosenString]
return
}
}
return
你不想GUI消失吗? 在第44行添加
NoHide
,如下所示:
Gui,DisplayResults:Submit,NoHide
您不想让Gui消失吗?
在第44行添加NoHide
,如下所示:
Gui,DisplayResults:Submit,NoHide
一旦用户选择其中一个单选按钮,您就确认选择。(用箭头键移动会选择你移动到上面的那一个,就像点击一样)那么你想添加其他确认选择的方法吗?可能添加一个“确认”按钮,或者点击回车确认?当用户选择其中一个单选按钮时,您正在确认选择。(用箭头键移动会选择你移动到上面的那一个,就像点击一样)那么你想添加其他确认选择的方法吗?可能会添加一个“确认”按钮,或者可能会让点击回车确认?