【AHK】自用模板新电脑快捷键自用习惯配置

新电脑第一课先配置快捷键

bash 复制代码
`::
send {backspace}
return

capslock::
send {enter}
return 



;========================================================

xbutton2::
    ToolTip,
    ;设置鼠标坐标模式为相对屏幕
    CoordMode, Mouse, Screen
    MouseGetPos, mX0, mY0 , hwnd
    IfWinExist, ahk_id %hwnd%
    {
        ;获取初始窗口位置
        WinGetPos, wX0, wY0
        WinActivate, ahk_id %hwnd%
    }
    Else
        Return
    Loop{
        GetKeyState, mState, xbutton2, P 
        if mState = U        
         {
            ToolTip 
            break
        }

        ;获取当前鼠标位置
        MouseGetPos, mX, mY
        SetWinDelay, -1
        WinMove, ahk_id %hwnd%,  , wX0+mX-mX0, wY0+mY-mY0
    }
Return

;========================================================

xbutton1::
setWinDelay,0
CoordMode,mouse,Screen

MouseGetPos,mx1,my1
WinGetPos,winx,winy,winw,winh,A
	loop{
	
		;GetKeyState,vstate,LAlt,p
		GetKeyState,vstate,xbutton1,p
		
		if vstate=U
			break		
		
		MouseGetPos,mx2,my2
		
		xx=% winw + mx2 - mx1
		yy=% winh + my2 - my1
		winmove,A,,%winx%,%winy%,%xx%,%yy%
		sleep,30
	}
Return


;===================调试bug=====================================

;有时候冲突,疯狂按下某个键的bug
!^+#q::
^!#q::
^+#q::
!+#q::
+#q::
!#q::
^#q::
#q::
send ^s
Sleep 1000
Reload

send {alt up}
send {shift up}
send {ctrl up}
send {win up}
return

;=================wechat==========================

#IfWinActive ahk_exe wechat.exe

^w::
send {esc}
return

!f:: ;聚焦搜索框
send !l+{tab 2}
return


!t::
!z:: ;文件传输transfer
send !l
sleep 200
send +{tab 4}
sleep 300
send {enter 3}
sleep 200
send {enter 3}
return


!q:: ;打开表情
send !l{tab 4}{space}
return

#IfWinActive

;=================msedge==========================

#IfWinActive ahk_exe msedge.exe


^!h::
PostMessage, 274, 40010
return

^!r::
PostMessage, 274, 40022
return

^!s::
PostMessage, 274, 40030
return


#IfWinActive

;========================================================


#F1::#.
~right & home:: send {end} ;右键专属用于调整
^#esc:: ;休眠
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
Return

#c::Run *RunAs cmd ,,

#F::Run C:\Program Files (x86)\Feem 2018\Feem.exe
#T::Run C:\Program Files\Typora\Typora.exe
#N::Run notepad


^#p::Run D:\软件\AdobePhotoshopCS4\Adobe Photoshop CS4\Photoshop.exe
^#e::Run "D:\软件\小工具2\Everything-1.4.1.1022.x86\Everything.exe"
^#h::run D:\软件\HBuilderX\HBuilderX.exe


;========================================================


sendASC(str){
Send % "{ASC 0" . Asc(str) . "}"
}


!,:: sendASC(",")
!.:: sendASC(".")

!+,:: sendASC("<")
!+.:: sendASC(">")
相关推荐
liuyukuan6 个月前
[AHK V2]SQLite测试用例
数据库·sqlite·ahk·autohotkey
liuyukuan6 个月前
[AHK V2]鼠标悬停展开窗口,鼠标离开折叠窗口
ahk·autohotkey·v2
liuyukuan9 个月前
【AHK v2】数据结构LinkedList实现示例
数据结构·ahk·autohotkey·v2
liuyukuan1 年前
[AHK]一键调用office365的“放置在单元格中”功能
ahk
LAM LAB1 年前
【AHK】通过唤醒窗口快捷菜单调节窗口位置/打开窗口控制菜单的其他方法
ahk