大部分播放器没有mpv的单键快捷键还不给改很烦人,所以自己加了一套按键,这是按键的部分,然后后面提供从ini配置读取希望改按键组的方法
;*****************************************非mpv播放器相关增强*********************************
#If WinActive("ahk_group player") and (player = 1)
n:: SendInput, {right 3}
m:: SendInput, {left 3}
j::SendInput, {right}
k::SendInput, {left}
q::WinClose A
Enter::GoSub,Sub_MaxRestore
#If
Sub_MaxRestore:
WinGet, Status_minmax ,MinMax,A
If (Status_minmax=1){
WinRestore A
}
else{
WinMaximize A
}
return
#If WinActive("ahk_group player")
!d:: Togglefunc("player")
#If
用到的函数和读取ini的方法
getINIGroupp(hzn_keyBoard,"player","player")
Togglefunc(name){
%name%:=%name%==1 ? 0 : 1
(%name%==1) ? ttip("打开" name,500) : ttip("关闭" name,500)
}
getINIGroupp(INIVar:="",groupName:="",sec:=""){
hzn_keyBoard:= class_EasyIni("hzn_keyBoard.ini")
for k,v in hzn_keyBoard[sec]
{
if (k = "")
continue
MyVar_Key := RegExReplace(v, "=.*?$")
MyVar_Val := RegExReplace(v, "^.*?=")
if (MyVar_Key && MyVar_Val) {
prefix := SubStr(MyVar_Val, 1, 3)
if (prefix = "uwp"){
uwp_app := SubStr(MyVar_Val, 5)
GroupAdd, %groupName%, ahk_exe ApplicationFrameHost.exe, %uwp_app%
GroupAdd, %groupName%, %uwp_app%
}else{
GroupAdd, %groupName%, %MyVar_Val%
}
}
}
}