【发布时间】:2014-11-05 12:57:47
【问题描述】:
我买了一个新鼠标,上面有一个滚轮,我已经做了一个变量(Quote_Selector)增加或减少辅助鼠标滚轮转动的方式。此变量中的整数也是定义我的按钮从数组发送的消息的关键。问题是试图将 Quote_Selector 链接为一个键,以提取显示的数组中的消息并发送它。我的目标是尽量让它尽可能干净。我什至尝试过使用 对于表达式中的键 [,value] 但我似乎想不出任何东西。我正在使用 AutoHotKey 语言和软件。
; Declare Variables
Quote_Selector = 0
Min_Selector_Range = 0
Max_Selector_Range = 3
; Declare Message Choices
MessageArray := []
MessageArray[0] := "Darude - Sandstorm"
MessageArray[1] := "Rekt"
MessageArray[2] := "I cry all the time"
MessageArray[3] := "My anaconda don't"
return
; Forward Key Command
$=::
{
If Quote_Selector < %Max_Selector_Range%
Quote_Selector ++
Send, %Quote_Selector%
}
return
; Backward Key Command
$-::
{
If Quote_Selector > %Min_Selector_Range%
Quote_Selector --
Send, %Quote_Selector%
}
return
; Enter Chat Command
$0::
{
Send, {Enter}
Send, /all{space} %value%
Send, {enter}
}
return
【问题讨论】:
-
您需要编辑并添加一个标签,表明您正在使用的语言/技术。
-
我修好了,你能告诉我该怎么做吗?
标签: arrays variables key autohotkey