1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| CoordMode "Mouse", "Screen" ; 将鼠标坐标模式设置为整个屏幕 SendMode "Event" ; 设置发送模式为事件模式
ExtendBilibili(key, count) { xpos := 0 ypos := 0 originalWinHwnd := WinExist("A") ; 获取当前活动窗口的HWND MouseGetPos &xpos, &ypos ; MsgBox Format("1- {1} {2}", xpos, ypos) MouseMove 2300, 1050, 0 ; 移动到视频范围 MouseClick "left", , , , 5 ; 点击一处无关紧要的地方,使视频应用聚焦 Loop count ; 根据提供的次数重复发送键 { Send key } ; MsgBox Format("2- {1} {2}", xpos, ypos) Sleep 50 MouseMove xpos, ypos, 0 ; 鼠标移回原处 WinActivate("ahk_id " . originalWinHwnd) ; 激活原始窗口 }
#!Space:: ; Win + Alt + Space { ExtendBilibili("{Space}", 1) }
#!Left:: ; Win + Alt + Left { ExtendBilibili("{Left}", 3) }
#!Right:: ; Win + Alt + Right { ExtendBilibili("{Right}", 2) }
#!Up:: ; Win + Alt + Up { xpos := 0 ypos := 0 originalWinHwnd := WinExist("A") ; 获取当前活动窗口的HWND MouseGetPos &xpos, &ypos MouseMove 2300, 1050, 1 MouseClick "left", , , , 0 Sleep 2000 MouseMove xpos, ypos, 0 WinActivate("ahk_id " . originalWinHwnd) ; 激活原始窗口 }
|