1

私は近づいていますが、トリガーを機能させることができません。ドラッグ中に右クリックして、現在ドラッグしている (アクティブな) ウィンドウを画面の 4 分の 1 にスナップできるようにしたいと考えています。マウスが現在上にある画面の 4 分の 1 にスナップする必要があります。トリガーは、私が欠けていると感じているものです。マウスの右ボタンを離すと、アクティブなウィンドウがマウスの位置に相対的な大きさに移動します。アドバイス?

~Lbutton & ~Rbutton::

    CoordMode,Mouse,Screen  ;mouse position relative to the screen
    MouseGetPos,Xpos,Ypos   ;get mouse position coordinates
    ;WinGet, active_id, ID, A
    ;msgbox %Xpos%,%Ypos%   ;show the saved mouse coordinates 

    RIGHT_height=537
    RIGHT_width=848
    RIGHT_leftpos=1680
    RIGHT_rightpos=2523
    RIGHT_toppos=-70
    RIGHT_vp=460    

    LEFT_height=518
    LEFT_width=847
    LEFT_leftpos=-8
    LEFT_rightpos=834
    LEFT_toppos=-10
    LEFT_vp=503

    ;LEFT SCREEN
    if (Xpos < LEFT_rightpos and ypos < LEFT_vp) {  ;LEFT top left
        WinMove,Untitled - Notepad,,%LEFT_leftpos%,%LEFT_toppos%,%LEFT_width%,%LEFT_height%

    }

    if (Xpos > LEFT_rightpos and Xpos < 1680 and ypos < LEFT_vp) {  ;LEFT top right
        MsgBox LEFT top right
    }

    if (Xpos < LEFT_rightpos and Xpos < 1680 and ypos > LEFT_vp) {  ;LEFT top right
    msgbox LEFT Bottom Left
    }

    if (Xpos > LEFT_rightpos and Xpos < 1680 and ypos > LEFT_vp) {  ;LEFT top right
    msgbox LEFT Bottom Right
    }

    ;RIGHT SCREEN
    if (Xpos < RIGHT_rightpos and Xpos >= 1680 and ypos < RIGHT_vp) {   ;RIGHT top left
    msgbox RIGHT Top Left
    }

    if (Xpos > RIGHT_rightpos and Xpos >= 1680 and ypos < RIGHT_vp) {   ;RIGHT top right
    msgbox RIGHT Top Right
    }

    if (Xpos < RIGHT_rightpos and Xpos >= 1680 and ypos > RIGHT_vp) {   ;RIGHT top right
    msgbox RIGHT Bottom Left
    }

    if (Xpos > RIGHT_rightpos and Xpos >= 1680 and ypos > RIGHT_vp) {   ;RIGHT top right
    msgbox RIGHT Bottom Right
    }


return
4

1 に答える 1

0

こんなこともあるかも

#SingleInstance force
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
CoordMode, Mouse, Screen
hx := A_ScreenWidth/2, hy := A_ScreenHeight/2
return

#if GetKeyState("LButton", "P")
RButton up::
Send {LButton up}
WinGet, aWin, ID, A

MouseGetPos, oX, oY, oWin, oControl
if (oX<hx) and (oY<hy)
    WinMove, AHk_id %aWin%,, 0,0, %hx%, %hy%
else if (oX>hx) and (oY>hy)
    WinMove, AHk_id %aWin%,, %hx%,%hy%, %hx%, %hy%
else if (oX>hx) and (oY<hy)
    WinMove, AHk_id %aWin%,, %hx%,0, %hx%, %hy%
else if (oX<hx) and (oY>hy)
    WinMove, AHk_id %aWin%,, 0,%hy%, %hx%, %hy%
return

あなたのために働くかもしれませんが、1つの画面設定でのみ

于 2013-09-18T12:52:16.963 に答える