AHK的快速使用(兼容linux一些操作)


一些快捷键的说明

esc和capslock互换

$CapsLock::ESC
$ESC::CapsLock

快捷键

^+m::WinMaximize, A ; 设置一个快捷键来最大化当前窗口
^1::WinMinimize, A ;设置一个快捷键来最小化当前窗口

;ctrl+c设置为esc
^c::
Send {ESC}
return

;删除键
^h::
Send {BackSpace}
return

;行删除键 其中$开头是为了不屏蔽^u的本来的键值
$^u::
WinGetClass, class, A
if (class="PuTTY")
{
Send ^u
}
else
{
Send {shift}+{home}{BackSpace}
}
return

;Ctrl + j改为回车
^j::
Send {Enter}
return

;重命名
^+r::
Click right
Send {M}
return

;新建文本文档
^+t::
Click right
loop 2
{
Send {up}
}
Send {right}
loop 7
{
Send {down}
}
Send {Enter}
return

;打开bash
^!b::
Click right
Send {g}{down}{enter}
return

;打开关闭桌面
^!+t::
Click right
Send {v}{d}
return

打开网页

;https://mp.csdn.net/console/article
;打开百度
^!w::Run http://www.baidu.com
;http://ehall.cqupt.edu.cn/new/index.html
;打开qq音乐
^!y::run "D:\qqmusic\QQMusic.exe"
;打开有道词典
^!0::run "D:\Dict\YoudaoDict.exe"
;打开钉钉
^!d::run "D:\DingDing\DingtalkLauncher.exe"
return
;打开keil "D:\Keil\UV4\UV4.exe"
^!k::run "D:\Keil\UV4\UV4.exe"
return

;windows快捷键
vscode
^!c::
run "F:\Microsoft VS Code\Code.exe"
return


最小化当前窗口
^1::WinMinimize, A ;设置一个快捷键ctrl + 1来最小化当前窗口,其中
A的含义如下
在这里插入图片描述
最大化窗口
在这里插入图片描述
vim
^j::send,{left}
^l::send,{right}
^i::send,{up}
^k::send,{down}
+^j::send,{shift}+{left}
+^l::send,{shift}+{right}

win10启动文件夹:

%programdata%\Microsoft\Windows\Start Menu\Programs\Startup
在这里插入图片描述

将autohotkey文件放入此文件夹中,即可开启自启动



;$CapsLock::ESC
;$ESC::CapsLock



;重命名
^+r::
Click right 
Send {M}
return
;新建文本文档
^+t::
Click right 
loop 2
{
 Send {up}
}
Send {right}
loop 7
{
 Send {down}
}
Send {Enter}
return

;打开bash
^!b::
Click right 
loop 8
{
 Send {up}
}
Send {Enter}
return
;Ctrl + j改为回车
^j::
Send {Enter}
return
;Ctrl + c改为ESC
;^c::
;Send {ESC}
;return

;删除键
$^h::
WinGetClass, class, A
if (class="PuTTY" or class="vwr::CDesktopWin")
{	
	Send ^h
}
else
{
	Send {BackSpace}
}
return

;删除键
$^u::
WinGetClass, class, A
if (class="PuTTY" or class="vwr::CDesktopWin")
{	
	Send ^u
}
else
{
	Send {shift}+{home}{BackSpace}
}
return


;打开文章
^!w::Run https://www.baidu.com
;打开qq音乐
^!y::run "D:\qqmusic\QQMusic.exe"
;打开有道词典
^!0::run "D:\Dict\YoudaoDict.exe"
;打开钉钉
^!d::run "D:\DingDing\DingtalkLauncher.exe"
;打开VM
^!v::run "F:\VMWare\vmware.exe"
^1::WinMinimize, A  ;设置一个快捷键来最小化当前窗口

;快速打开文件夹
;用run打开
;+!e::
;Run ,C:\Users\WILLPOWER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\Run
;Sleep, 300
;Send E:\ {Enter}
;return

+!e::
Run ,E:\
return

+!c::
Run ,c:\
return

+!d::
Run ,d:\
return

+!g::
Run ,G:\
return

+!w::
Send efr32MG21A020F
return





在这里插入图片描述

鼠标右键+滚轮提供音量控制
出处

;使用:按住鼠标右键,滑动滚轮调节音量。
;2010.04.12
;NiGH优化.
#MaxThreads 6
#InstallKeybdHook
color1 = 6BD536
color2 = FFFFFF
color3 = 94632D
color4 = FFCD00
color5 = AA55AA
color6 = FF5555
random,n,1,6
barcolor := color%n% ;取随机色的写法,我会看下色彩的理论,再写出随机生成颜色的代码,因为我还不知道计算明度跟饱和度的公式.
current := 80 ;初始音量值
gui,1:-caption +alwaysontop +owner ;去标题栏
gui,1:margin,0,0 ;去边距
gui,1:color,3F3F3F ;随便设置一个背景色,以备后面设置透明用
gui,1:font,s16 cwhite,Arial
gui,1:add,text,x7 y0,-
gui,1:add,text,x190 y1,+
gui,1:add,progress,x21 y2 w165 h22 c%barcolor% background3F3F3F vMyProgress, 80
gui,1:show,w208 h26,mainboard
;~Gui,1:+LastFound ;设置为LastFound
;~GUI_ID:=WinExist() ;获得窗口的句柄
winset,TransColor,black 200,mainboard
gui,1:Hide
send, {volume_up 50}
send, {volume_down 10} ;我的win7用volume_up&down,效果出来都是双倍的,up10就是加20,下同
SetTimer, Check, 50
SetTimer, MenuCancel, 30
Return
Check:
GetKeyState,T,Rbutton
If (T = "U")
{
;~DllCall("AnimateWindow","UInt",GUI_ID,"Int",500,"UInt",0x90000)  ;以淡出的方式退出
Gui,1:hide
SetTimer, MenuCancel, Off
}
If (current > 100)
current := 100
If (current < 0)
current := 0
Return
MenuCancel:
IfWinExist,ahk_class #32768
WinClose,ahk_class #32768 ;在右键菜单出现时关闭它(因为它会遮盖住音量条).
Return
#IfWinExist, mainboard
wheeldown::
If (T = "D")
{
SetTimer, MenuCancel, On
Loop,5
{
  current:=current-2
  GuiControl,,MyProgress,%current%
  Sleep 50
}
Send {Volume_Down 5}
}
Return
WheelUp::
If (T = "D")
{
  SetTimer, MenuCancel, On
  Loop,5
  {
   current:=current+2
   GuiControl,,MyProgress,%current%
   Sleep 50
  }
  Send {Volume_Up 5}
}
Return
  #IfWinnotExist, mainboard
  ~wheeldown::
  If (T = "D")
  {
   SetTimer, MenuCancel, On
   gui,1:show
   Loop,5
   {
    current:=current-2
    GuiControl,,MyProgress,%current%
    Sleep 50
   }
   Send {Volume_Down 5}
  }
  Return
   ~WheelUp::
   If (T = "D")
   {
    SetTimer, MenuCancel, On
    gui,1:show
    Loop,5
    {
     current:=current+2
     GuiControl,,MyProgress,%current%
     Sleep 50
    }
    Send {Volume_Up 5}
   }
   Return

猜你喜欢

转载自blog.csdn.net/qq_37429313/article/details/108595545