[AHK2] 媒体管理

发布时间 2023-08-17 17:38:45作者: 落寞的雪

因为ahk提供了媒体管理的相关api,我们只需要调用即可。
要注意的是使用了之前写的常用的Tooltip,用于显示提示,并在几秒种后关闭它。

!PrintScreen:: SetMedia(0)
!Ins:: SetMedia(1)
!Del:: SetMedia(2)

SetMedia(op) {
    switch op {
        case 0:
            Send "{Media_Play_Pause}"
            k := '切换'
        case 1:
            Send "{Media_Prev}"
            k := '往前'
        case 2:
            Send "{Media_Next}"
            k := '向后'
        default: return
    }
    raw := '+===+`n'
        . ' | ' k ' |`n'
        . '+===+`n'
    Tip.ShowTip(raw)
}