跳转至

配置

键位映射

if !A_IsAdmin
{
    Run('*RunAs "' A_ScriptFullPath '"')
    ExitApp
}

; 左Alt左Ctrl
LAlt::LCtrl

; CapsLockEsc
CapsLock::Esc

; 左Ctrl左Alt
LCtrl::LAlt

; 右AltCapsLock
RAlt::CapsLock

; 右ShiftWin+H
RShift:: {
    Send "#h"
}
if !A_IsAdmin
{
    Run('*RunAs "' A_ScriptFullPath '"')
    ExitApp
}
#Requires AutoHotkey v2.0+

SetWinDelay(-1)          ; 禁用WinMove自动延时(默认100 ms)
; 如担心占用高可用 SetWinDelay(0) 给系统一次时间片

; Ctrl+Alt+左键拖动移动
^!LButton::{
    CoordMode("Mouse","Screen")
    hwnd := WinExist("A")
    WinGetPos(&wx,&wy,,, hwnd)
    MouseGetPos(&mx,&my)
    While GetKeyState("LButton","P"){
        MouseGetPos(&nx,&ny)
        WinMove(wx+(nx-mx), wy+(ny-my),,, hwnd)
        Sleep 0           ;  1000 Hz/CPU友好若仍嫌顿可试 Sleep 0
    }
}

; Ctrl+Alt+右键拖动缩放
^!RButton::{
    CoordMode("Mouse","Screen")
    hwnd := WinExist("A")
    MouseGetPos(&sx,&sy)
    WinGetPos(,, &ww,&wh, hwnd)
    While GetKeyState("RButton","P"){
        MouseGetPos(&nx,&ny)
        WinMove(,, ww+(nx-sx), wh+(ny-sy), hwnd)
        Sleep 0
    }
}
; Ctrl+SpaceWin+Space
^Space:: {
    Send "#{Space}"
}

开机自动启动

将脚本放到%APPDATA%\Romming\Microsoft\Windows\Start Menu\Programs\Startup这个路径下.

评论