win10改快捷键

2020-12-02  本文已影响0人  recopx

装AutoHotKey

自建MyScript.ahk

内容:

;Notes: #==win !==Alt ^==Ctrl +==shift ::分隔 run AHK命令

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

;Alt+Enter窗口置顶

!enter::

    WinGet ow, id, A

    WinTopToggle(ow)

    return

WinTopToggle(w) {

    WinGetTitle, oTitle, ahk_id %w%

    Winset, AlwaysOnTop, Toggle, ahk_id %w%

    WinGet, ExStyle, ExStyle, ahk_id %w%

    if (ExStyle & 0x8)  ; 0x8 为 WS_EX_TOPMOST.在WinGet的帮助中

        oTop = 置顶

    else

        oTop = 取消置顶

    tooltip %oTitle% %oTop%

    SetTimer, RemoveToolTip, 5000

    return

    RemoveToolTip:

    SetTimer, RemoveToolTip, Off

    ToolTip

    return

}

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

;Win+回车最大化窗口

#enter::

WinGet,S,MinMax,A

if S=0

    WinMaximize,A

else if S=1

    WinRestore,A

else if S=-1

    WinRestore,A

return

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

;以Ctrl+Q代替Alt+F4关闭窗口

^q::

send !{F4}

return

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

;Win+空格打开孤狗

#space::

run https://www.google.com/ncr

tooltip,

sleep 2000

tooltip,

return

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

;鼠标放在任务栏,滚动滚轮实现音量的加减

~lbutton & enter::

exitapp 

~WheelUp:: 

if (existclass("ahk_class Shell_TrayWnd")=1) 

Send,{Volume_Up} 

Return 

~WheelDown:: 

if (existclass("ahk_class Shell_TrayWnd")=1) 

Send,{Volume_Down} 

Return 

~MButton:: 

if (existclass("ahk_class Shell_TrayWnd")=1) 

Send,{Volume_Mute} 

Return 

Existclass(class) 

MouseGetPos,,,win 

WinGet,winid,id,%class% 

if win = %winid% 

Return,1 

Else 

Return,0 

}

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

;Win+PrtScr关闭显示器

#PrintScreen::

Sleep 1000  ; 让用户有机会释放按键 (以防释放它们时再次唤醒显视器).

SendMessage, 0x112, 0xF170, 2,, Program Manager  ; 0x112 为 WM_SYSCOMMAND, 0xF170 为 SC_MONITORPOWER.

return

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

 ;Win+T计时器

#+t::

var := 0

InputBox, time, 小海御用计时器, 请输入一个时间(单位是分)

time := time*60000

Sleep,%time%

loop,16

{

var += 180

SoundBeep, var, 500

}

msgbox 时间到!!!时间到!!!时间到!!!

return

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

;Win+C获取RGB色

#+c::

MouseGetPos, mouseX, mouseY

PixelGetColor, color, %mouseX%, %mouseY%, RGB

StringRight color,color,6

clipboard = %color%

msgbox Current color value is#%color%.

return

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

最后加入开机自启

上一篇 下一篇

猜你喜欢

热点阅读