本帖最后由 loms126 于 2013-5-22 09:51 编辑
100lj 发表于 2013-5-22 07:28
修改key.ini里的^a为千千静听默认的^Right代表CTRL+Right,没有反应。修改为^!Right全局键代表CTRL+ALT ...
哦,我忘记写这两个常见的箭头了
向左向右要写成
{left} 向左
{right} 向右
否则发送的是字符串,不是对应的按键。
请记得在千千静听中“启用全局热键”,否则会没有用。
加了存储时间的版本,周期在period.ini中修改即可:- #Warn ; Recommended for catching common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- FileReadLine,store_period,period.ini,1
- Gui, Add, Edit, x12 y10 w70 h20 vPeriod_timer,%store_period%
- Gui, Add, Text, x12 y40 w70 h20 vTime_remain,0
- Gui, Add, Button, x102 y10 w70 h25 gButton1 , Start
- Gui, Add, Button, x102 y40 w70 h25 gButton2 , Stop
- ; Generated using SmartGUI Creator for SciTE
- Gui, Show, w200 h83, Untitled GUI
- FileReadLine,key_costum,key.ini,1
- time_remaing_num = 0
- return
- GuiClose:
- ExitApp
- Button1:
- Gui, Submit,NoHide
- SetTimer, Timer_Func, off
- if (Period_timer*1>2)
- {
- period := Period_timer*1000
- period1 := Period_timer
- SetTimer, Timer_Func, %period%
- SetTimer, Timer_Func,on
- SetTimer, Timer_display, 1000
- SetTimer, Timer_display,on
- time_remaing_num := period1
- }
- else
- MsgBox, 16, Error, Wrogn number!
- ;send %key_costum%
- return
- Button2:
- Gui, Submit,NoHide
- SetTimer, Timer_Func, off
- SetTimer, Timer_display,off
- GuiControl,Text,Time_remain, ...Stop...
- return
- Timer_Func:
- send %key_costum%
- time_remaing_num := period1
- return
- Timer_display:
- time_remaing_num--
- GuiControl,Text,Time_remain,%time_remaing_num%
- return
复制代码 |