#NoEnv
#SingleInstance Force
SendMode Input
SetBatchLines -1
Process, Priority,, High
SetWorkingDir %A_ScriptDir%
Menu Tray, Icon, shell32.dll, 317
if !(A_IsUnicode=1 and A_PtrSize=8)
DllCall("Wow64DisableWow64FsRedirection")
; 开机启动声卡驱动+开机音量弹性调整+开机清空状态
Run C:\Program Files\Cyberdrive\Cyberdrive_Audio_Driver\CyberdriveCplApp.exe -hide
Run C:\xiaolv\弹性音量判断.ahk
FileDelete, C:\xiaolv\关闭屏幕\pingmu\dianshi\HDMI.txt
Return
*#q:: ; Win+Q,组合键暂停此脚本
Suspend
SoundPlay *-1
Return
; 在资源管理器中按鼠标访问上一级目录【指定窗口生效】
#ifWinActive, ahk_class CabinetWClass
~MButton Up::Send !{Up}
#ifWinActive
~MButton::Send {F13} ;屏蔽鼠标中键的滚轮光标功能
;鼠标侧边键改为,键4为单击暂停播放,双击停止,键5为下一首
XButton1::Goto 播放暂停下一首
XButton2::Goto 笔记本跨屏和编辑器
;键盘F6~F11,播放控制和音量控制
F6::Goto 播放暂停下一首
F7::Media_Prev
F8::Media_Next
F9::Volume_Mute
F10::Volume_Down
F11:: Volume_Up
Insert::Send {Backspace}
;分号键改成半角小写";"
vkBA::Send {text}`;
;左上角`键改成半角小写 `
vkC0::Send {text}``
;中文输入状态,Shift+《》。输出半角<>
>+,::
Send {Shift}{text}<
Send {Shift}
Return
>+.::
Send {Shift}{text}>
Send {Shift}
Return
;截图键或者Win+A,单击启动截图工具,并截图选框。双击为Gif截图
*PrintScreen::Goto 双击截图
#a::Goto 双击截图
;Win+S,启动OCR识别。配合MouseInc实现
#s::Send +S
;Win+W,剪贴板内容用Google翻译。配合MouseInc实现
#w::Send +O
;Win+F,启动文件快速搜索
#f::Run D:\工具\大杂烩\Everything(文件快速搜索) V1.4.1.949 绿色中文版\Everything.exe
;Win+P,切换屏幕
#p::Run C:\xiaolv\关闭屏幕\屏幕切换.ahk
;Shift+V,向iPhone同步剪贴板,判断是否启动、启动并发送,改按键
+v::
Process, Exist, AutoBark.exe
if ErrorLevel
Send +c
else {
Run C:\xiaolv\AutoBark.exe
Sleep 1500
Send +c
} Return
+c::Return
;组合键关机
~F12 & PrintScreen::Run C:\Windows\System32\shutdown.exe -s -t 0
;双击Alt,打开AHK帮助文档
~Alt Up::
t:=-Round(oldt)+(oldt:=A_TickCount)
if (t<100 || t>400)
Return
else oldt:=0
Goto 帮助文档呼出
Return
;【Win+G】打开AHK帮助文档
#g::Goto 帮助文档呼出
;【Ctrl+D】用于快速测试剪贴板的代码
^d::
s:=Clipboard
if (s="")
return
FileDelete, %A_Temp%\~test.ahk
FileAppend, % RegExReplace(s,"\R","`r`n"), %A_Temp%\~test.ahk
Run "%A_AhkPath%" /r "%A_Temp%\~test.ahk",, UseErrorLevel
Tip("新的脚本已运行!"), s:=""
return
;【Win+X】一键清理其它AHK进程
#x::
DetectHiddenWindows, On
WinGet, list, List, ahk_class AutoHotkey
Loop, %list% {
ifEqual, A_ScriptHwnd, % id:=list%A_Index%, Continue
WinGet, pid, PID, ahk_id %id%
WinClose, ahk_id %id%,, 1
ifWinExist, ahk_id %id%
Process, Close, %pid%
}
Tip("其他AHK程序已经退出!")
Run *RunAs C:\xiaolv\鼠标快捷操作\Google后台翻译+划词翻译.ahk
Return
Tip(s:="") {
SetTimer %A_ThisFunc%, % s="" ? "Off" : -1500
ToolTip %s%
}
;【Ctrl+S】剪贴板内容用百度搜索
*^s::
ClipHuanYuan := ClipboardAll
Clipboard := ""
Send ^c
ClipWait, 2
if (SubStr(Clipboard, 1, 4)="http")
Run, %Clipboard%
else if InStr(Clipboard,.com)
Run, https://%Clipboard%
else
Run, https://www.baidu.com/s?wd=%Clipboard%&ie=UTF-8
Clipboard := ""
Clipboard := ClipHuanYuan
ClipHuanYuan := ""
Return
;切换音响强制重置音量。配合SoundSwitch实现
~^+z::
Sleep 200
Run C:\xiaolv\弹性音量判断.ahk
Return
; 单击判断笔记本是否在线,在线就开启跨屏功能。双击打开AHK编辑器
Break::Goto 笔记本跨屏和编辑器
;Foobar2000音乐播放器,一键歌词+音乐频谱开关【红外遥控】==================【可以作废】
PgUp::
Run D:\Program Files\foobaka\yinliang\桌面频谱开关.ahk
歌词自判断:
RegRead, 歌词判断, HKCU\Software\dbgba, geci
Process, Exist, foobar2000.exe
if ErrorLevel
if (歌词判断="off") {
Send {Browser_Favorites}
RegDelete, HKCU\Software\dbgba,geci
} else {
Send {Browser_Favorites}
RegWrite, REG_SZ, HKCU\Software\dbgba,geci, off
} Return
;Foobar2000音乐播放器,歌词自判断【红外遥控】
PgDn::Goto 歌词自判断
;主页映射 - 单击为鼠标点击,双击为远程控制【红外遥控】
Browser_Home::
if (winc_presses > 0) {
winc_presses += 1
Return
} winc_presses := 1
SetTimer KeyWinC2, -1300
Return
KeyWinC2:
if (winc_presses = 1) {
CoordMode Mouse
Click, 852, 459
} else if (winc_presses = 2)
Run C:\Program Files (x86)\ToDesk\ToDesk.exe
winc_presses := 0
Return
;停止 - 切换音响【红外遥控】
Media_Stop::Send ^+Z
;快进 - 打开NAS【红外遥控】==================【可以扩展双击】
^+B::
Run D:\Program Files\Kodi\kodi.exe
SetTimer Sc922, -5000
Return
Sc922::Run C:\xiaolv\关闭屏幕\OffScreen\OffScreen.exe
;快退 - 红外,开关显示器【红外遥控】
^+F::Run C:\xiaolv\关闭屏幕\电脑自动化\组合键 - 开关显示器.ahk
;Win+E,我的电脑 - 红外切换开关【红外遥控】==================【可以更换】
#e::Run C:\xiaolv\关闭屏幕\电脑自动化\智能红外切换.ahk
;显示桌面双击扩展【红外遥控】==================【可以扩展双击】
;~#d::
;t:=-Round(oldt)+(oldt:=A_TickCount)
;if (t<100 || t>400)
; Return
;else oldt:=0
;Run C:\xiaolv\关闭屏幕\即将断电关机,请注意保存.txt
;Return
;邮件映射 - 单击为关机提醒,双击为打开QQ 【红外遥控】
Launch_Mail::
if (winc_presses > 0) {
winc_presses += 1
Return
} winc_presses := 1
SetTimer KeyWinC5, -1500
Return
KeyWinC5:
if (winc_presses = 1)
Run Notepad C:\xiaolv\关闭屏幕\即将断电关机,请注意保存.txt
else if (winc_presses = 2)
Run "D:\Program Files (x86)\Tencent\QQ\Bin\QQScLauncher.exe"
winc_presses := 0
Return
;屏幕切换到PC【红外遥控】
^!1::
if (winc_presses > 0) {
winc_presses += 1
Return
} winc_presses := 1
SetTimer KeyWinC4, -1300
Return
KeyWinC4:
if (winc_presses = 1)
Run C:\xiaolv\关闭屏幕\屏幕切换PC.ahk
else if (winc_presses = 2)
Run C:\xiaolv\关闭屏幕\屏幕切换PC - PS5开机.ahk
winc_presses := 0
Return
;关闭屏幕【红外遥控】
^!2::Run C:\xiaolv\关闭屏幕\OffScreen\关闭屏幕.exe
;屏幕切换【红外遥控】
^!4::Run C:\xiaolv\关闭屏幕\屏幕切换.ahk
;电脑自动化的3个按键映射
*ScrollLock::Run C:\xiaolv\关闭屏幕\电脑自动化\长按 - 开关流光溢彩.ahk
*Home::Run C:\xiaolv\关闭屏幕\电脑自动化\双击 - 吸顶灯.ahk
*End::Run C:\xiaolv\关闭屏幕\电脑自动化\组合键 - 开关显示器.ahk
;https://blog.csdn.net/liuyukuan/article/details/81950299
;Everything搜索,按Crtl+Enter直接网络搜索
#ifWinActive ahk_class EVERYTHING
^Enter::
ControlGetText, Keywords, Edit1, A
OutputDebug %Keywords%
Run, http://www.baidu.com/s?wd=%Keywords%
Return
#ifWinActive
; 右键双击Notepad++标题栏,切换到AHK高亮显示【针对高亮Bug】
#ifWinActive ahk_class Notepad++
~*RButton::
t:=-round(oldt)+(oldt:=a_tickcount)
if (t<100 || t>400)
return
else {
oldt:=0
MouseGetPos, 横坐标, 纵坐标, 窗口ID, 类编号
if (A_ThisHotkey ~= "RButton") {
if (横坐标>50*(A_ScreenDPI/120)) && (横坐标<1092*(A_ScreenDPI/120)) && (纵坐标>0) && (纵坐标<33*(A_ScreenDPI/120)) {
Send !l
Sleep 50
Send a
Send a
Send {Enter}
}
}
}
Return
#ifWinActive
;在任务栏上滚动鼠标来调节音量,中键单击或者左键双击空白处切换音量到100,并保存当前音量
#if MouseIsOver("ahk_class Shell_TrayWnd")
WheelUp::Send {Volume_Up}
WheelDown::Send {Volume_Down}
~*LButton::
t:=-Round(oldt)+(oldt:=A_TickCount)
if (t<100 || t>400)
Return
else oldt:=0
MouseGetPos, 横坐标, 纵坐标
if (横坐标>A_ScreenWidth/8.7*(A_ScreenDPI/96)) && (横坐标<A_ScreenWidth/1.16*(A_ScreenDPI/96)) && (纵坐标>0) && (纵坐标<A_ScreenHeight/27*(A_ScreenDPI/96))
Goto 音量切换标签
Return
; if (横坐标>220*(A_ScreenDPI/96)) && (横坐标<1650*(A_ScreenDPI/96)) && (纵坐标>0) && (纵坐标<40*(A_ScreenDPI/96))
音量切换标签:
~MButton::
SoundGet, 当前音量
if (当前音量 = 100) {
RegRead, 缓存音量, HKCU\Software\dbgba, yinliang
SoundSet, %缓存音量%
} else {
SoundGet, 当前音量
RegDelete, HKCU\Software\dbgba,yinliang
RegWrite, REG_SZ, HKCU\Software\dbgba,yinliang, %当前音量%
SoundSet, 100
} Return
MouseIsOver(WinTitle) {
MouseGetPos,,, Win
Return WinExist(WinTitle . " ahk_id " . Win)
}
#if
播放暂停下一首:
if (winc_presses > 0) {
winc_presses += 1
Return
} winc_presses := 1
SetTimer KeyWinC, -400
Run D:\Program Files\foobaka\yinliang\动态音量+播放器启动.ahk
Return
KeyWinC:
if (winc_presses = 1)
Send {Media_Play_Pause}
else if (winc_presses = 2)
Send {Media_Next}
winc_presses := 0
Return
双击截图:
if (winc_presses > 0) {
winc_presses += 1
Return
} winc_presses := 1
SetTimer KeyWinC3, -400
Return
KeyWinC3:
if (winc_presses = 1) {
Process, Exist, Snipaste.exe
if ErrorLevel
Run D:\Program Files\Snipaste\Snipaste.exe snip
else {
Run D:\Program Files\Snipaste\Snipaste.exe snip
WinWait, ahk_exe Snipaste.exe
Run D:\Program Files\Snipaste\Snipaste.exe snip
} } else if (winc_presses = 2)
Run D:\Program Files\Snipaste\GifCam功能扩展辅助.ahk
winc_presses := 0
Return
帮助文档呼出:
if WinExist("ahk_class HH Parent")
WinActivate, ahk_class HH Parent
else {
Run D:\装机必备\AHK热键工具\AutoHotkey-v1.1.33.02_帮助文件中文.chm
Sleep 1000
WinSetTitle, ahk_class HH Parent, , AutoHotkey 中文帮助 〔Ctrl+回车:可用 AutoAHK 搜索〕
sousuoX := 219*(A_ScreenDPI/96)
sousuoY := 70*(A_ScreenDPI/96)
ControlClick, x%sousuoX% y%sousuoY%, ahk_class HH Parent
Sleep 500
ControlClick, x%sousuoX% y%sousuoY%, ahk_class HH Parent
WinActivate, ahk_class HH Parent
WinSetTitle, ahk_class HH Parent, , AutoHotkey 中文帮助 〔Ctrl+回车:可用 AutoAHK 搜索〕
} Return
; 帮助文档搜索框按Ctrl+回车,用百度搜索关键词
#ifWinActive ahk_class HH Parent
RCtrl & Enter::
ClipHuanYuan := ClipboardAll
Clipboard := ""
Send ^a
Send ^x
ClipWait, 2
Run, https://www.autoahk.com/?s=%Clipboard%&type=post
Clipboard := ""
Clipboard := ClipHuanYuan
ClipHuanYuan := ""
Return
#ifWinActive
笔记本跨屏和编辑器:
if (winc_presses > 0) {
winc_presses += 1
Return
} winc_presses := 1
SetTimer KeyWinC6, -400
Return
KeyWinC6:
if (winc_presses = 1) {
SoundPlay *16
Process, Close, ShareMouse.exe
Run D:\Program Files\ShareMouse\ShareMouse.exe,,, NewPID9
Process, Priority, %NewPID9%, High
Run C:\xiaolv\kuaping.ahk
} else if (winc_presses = 2) {
Run "D:\Program Files (x86)\Notepad++\notepad++.exe"
} winc_presses := 0
Return
;中文输入状态,Shift+"。输出半角"
>+'::
Send {Shift}{text}`"
Send {Shift}
Return
暂无讨论,说说你的看法吧