最近对鼠标的侧键,滚轮写了一些强化的脚本,以及之前做的连点器,做了一个聚合,现在放在统一一个gui上进行使用
统一进行一个发布
通过gif简单看一下这个工具的使用,仅提供简单的gui,想要提升体验自己修改这个gui或者触发的方式即可
侧键的功能直接在gui里面点击切换即可
滚轮的有两个功能,一个是快速切换滚轮的移动举例为一个常用的数字,可以自己改大,我使用的3个格子
还有就是按住中间和滚轮的速度调整,可以自己改一个很大数字,这里演示了改成100,可以快速移动超长距离
如果想要加入一些延时,可以自己在源码中调整
源码部分
if !(A_IsAdmin || InStr(DllCall("GetCommandLine", "str"), ".exe"" /r"))
Run % "*RunAs " (s:=A_IsCompiled ? "" : A_AhkPath " /r ") """" A_ScriptFullPath """" (s ? "" : " /r")
GV_ToggleKeyMode := 0
GroupAdd,飞鼠避让, ahk_exe TOTALCMD.EXE
GroupAdd,飞鼠避让,ahk_exe mpv.exe
GroupAdd,飞鼠避让,ahk_exe 360chrome.exe
SetBatchLines,-1
SetKeyDelay,-1
SetMouseDelay,-1
gui Destroy
Gui Add, Tab3,, 鼠标|键盘
Gui Tab, 1
gui +AlwaysOnTop
gui font, s12, Verdana
gui Add, Text,section cRed,鼠标侧键相关:
gui Add, Text,x+5 ,侧键1
Gui add, DropDownList, v侧键1 g读入功能 x+5,copy|paste|PgUp|PgDn|cPgDn|cPgUp|up||down|Home|end|chome|cend|mpv大跳|mpv小跳|downenter|upenter|tc显示大小
gui Add, Text,x+5,侧键2
Gui add, DropDownList, v侧键2 g读入功能 x+5, copy|paste|PgUp|PgDn|cPgDn|cPgUp|up|down||Home|end|chome|cend|mpv大跳|mpv小跳|downenter|upenter|tc显示大小
gui add,Button,x+5 greload,Reload
Gui Add, Text,xs cRed,滚轮距离相关:
Gui Add, Text,x+5,Up
Gui Add, Edit,x+5 w100 vup gsubmit,3
Gui Add, Text,x+5,Down
Gui Add, Edit,x+5 w100 vdown gsubmit,3
gui Add,Checkbox,x+5 gsubmit vkg Checked,修改普通滚轮为三次滚动
Gui Add, Text,xs cRed,连点:
Gui add, DropDownList,w60 x+5 v点击按键 gsubmit, Left||Middle|Right
Gui add, DropDownList,w60 x+5 v相对坐标 gsubmit, 窗口||屏幕
Gui Add, Text,x+5,循环次数
Gui Add, Edit,x+5 v循环次数 gsubmit,5
Gui Add, Text,x+5,横轴
Gui Add, Edit,x+5 v横轴 gsubmit,0
Gui Add, Text,x+5,纵轴
Gui Add, Edit,x+5 v纵轴 gsubmit,0
Gui Add, Text,x+5,间隔时间
Gui Add, Edit,x+5 v间隔时间 gsubmit,0
Gui add, button,x+5 g简单尺子,简单尺子
Gui add, button,x+5 g连点,连点
Gui Tab, 2
Gui Add, Text, w-2 h-2 section
For k,v in ["飞鼠开关","reload"]
Gui Add, Button, x+5 g%v%,%v%
Gui, submit, NoHide
Gui Show,,hzn_tools
return
Reload:
Reload
return
XButton1::
XButtonfunc(侧键1)
return
XButton2::
XButtonfunc(侧键2)
return
读入功能:
Gui submit, NoHide
return
XButtonfunc(which){
switch which
{
case copy:
copy()
case paste:
SendInput,^v
case PgUp:
SendInput,{PgUp}
case PgDn:
SendInput,{PgDn}
case Up:
SendInput,{up}
case down:
SendInput,{down}
case Home:
SendInput,{Home}
case end:
SendInput,{end}
case chome:
SendInput,^{Home}
case cend:
SendInput,^{end}
case cPgUp:
SendInput,^{PgUp}
case cPgDn:
SendInput,^{PgDn}
case mpv大跳:
SendInput,n
case mpv小跳:
SendInput,m
case downenter:
SendInput,{down}{Enter}
case Upenter:
SendInput,{up}{Enter}
case tc显示大小:
SendInput,!+{Enter}
}
}
Copy(){
Clipboard:=""
Send,^c
ClipWait,1,1
return Clipboard
}
#If kg=1
WheelUp::
Loop, 3
MouseClick, WheelUp
return
WheelDown::
Loop, 3
MouseClick, WheelDown
return
#if
RemoveToolTip:
ToolTip
return
submit:
Gui, submit, NoHide
return
MButton & WheelUp::
#Persistent
ToolTip, up %up% times
SetTimer, RemoveToolTip, -2000
Loop, %up%
MouseClick, WheelUp
return
MButton & WheelDown::
#Persistent
ToolTip, Down %down% times
SetTimer, RemoveToolTip, -2000
Loop, %down%
MouseClick, WheelDown
return
连点:
ToolTip,等待右键点击开始连点
if (相对坐标:="窗口"){
KeyWait, RButton, D
MouseGetPos,x,y
loop %循环次数%{
click,%x%,%y%,%点击按键%
y:=y+纵轴 , x:=x+横轴
Sleep %间隔时间%
}
}
if (相对坐标:="屏幕"){
KeyWait, RButton, D
MouseGetPos, xScreen, yScreen
loop %循环次数%{
ClickPosition(%xScreen%,%yScreen%, 1, 0, "Screen", true)
click,%xScreen%,%yScreen%,%点击按键%
yScreen:=yScreen+纵轴 , xScreen:=xScreen+横轴
Sleep %间隔时间%
}
}
ToolTip
Return
简单尺子:
ToolTip,等待右键点击开始测量第一个点
KeyWait, RButton, D
MouseGetPos,x1,y1
ToolTip,"第一个点横坐标为" x1 "纵坐标为" y1 "移动到下一个点松开右键"
KeyWait, RButton, a
MouseGetPos,x2,y2
横轴差额:=x2-x1 , 纵轴差额:=y2-y1
MsgBox,
(
第一个点横坐标为 %x1% 纵坐标为 %y1%
第二个点横坐标为 %x2% 纵坐标为 %y2%
提示,向右横坐标变大,向下纵坐标变大
横轴的差额为 %横轴差额%
纵轴的差额为 %纵轴差额%
)
ToolTip
Return
;************** 飞鼠模式 **************
#If (GV_ToggleKeyMode=1) and !WinActive("ahk_group 飞鼠避让")
;方向键,滚轮
j::MouseClick, WheelDown,,, 2
k::MouseClick, WheelUp,,, 2
d::MouseClick, WheelDown,,, 2
a::MouseClick, WheelUp,,, 2
h::Send {Left}
l::Send {Right}
;鼠标
':: Send {Click Right}
`;:: Send {Click}
;切换程序
; d:: {alt Down}{Tab}{alt Up}
; a:: {Shift Down}{alt Down}{Tab}{Shift Up}{alt Up}
;w和s对应home和end,对应的是vimium扩展的按键思路
s::
KeyWait, F1, T0.5
if (winc_presses > 0) {
winc_presses ++
return
} winc_presses = 1
SetTimer KeyWinC1, -400
return
KeyWinC1:
if (winc_presses = 1) {
SendInput, {end}
} else if (winc_presses = 2) {
SendInput, ^{end}
} winc_presses = 0
return
w::
KeyWait, F1, T0.5
if (winc_presses > 0) {
winc_presses ++
return
} winc_presses = 1
SetTimer KeyWinC2, -400
return
KeyWinC2:
if (winc_presses = 1) {
SendInput, {home}
} else if (winc_presses = 2) {
SendInput, ^{home}
} winc_presses = 0
return
;上下翻页,来自mpv的按键思路,nm大跳
n::
KeyWait, F1, T0.5
if (winc_presses > 0) {
winc_presses ++
return
} winc_presses = 1
SetTimer KeyWinC3, -400
return
KeyWinC3:
if (winc_presses = 1) {
SendInput,{PgDn}
} else if (winc_presses = 2) {
SendInput,^{PgDn}
} winc_presses = 0
return
m::
KeyWait, F1, T0.5
if (winc_presses > 0) {
winc_presses ++
return
} winc_presses = 1
SetTimer KeyWinC4, -400
return
KeyWinC4:
if (winc_presses = 1) {
SendInput,{PgUp}
} else if (winc_presses = 2) {
SendInput,^{PgUp}
} winc_presses = 0
return
;复制粘贴对应的是vim的yank等
y::
Clipboard:=""
SendInput, ^c
ClipWait, 1, 1
ToolTip, 复制成功, , ,
Sleep 500
ToolTip
return
p::SendInput, ^v
z::SendInput,^z
;左右切换标签以及关闭标签以及返回历史同样来自vimium的按键思路
q:: send,{Blind}^+{Tab}
e:: send,{Blind}^{Tab}
.:: SendInput,^w
x:: SendInput,^w
b:: SendInput, ^{left}
;使用数字键来切换软件
1::SendInput, #1
2::SendInput, #2
3::SendInput, #3
4::SendInput, #4
5::SendInput, #5
6::SendInput, #6
7::SendInput, #7
8::SendInput, #8
9::SendInput, #9
#If
^F1::
飞鼠开关:
GV_ToggleKeyMode := !GV_ToggleKeyMode
if(GV_ToggleKeyMode == 1)
ToolTip 飞鼠模式启用
else
ToolTip 飞鼠模式关闭
Sleep 2000
ToolTip
return