De Move a window to the bottom/top monitor with a shortcut on Windows by Tymric :
Eu escrevi um script AHK.
Usage:
Win + Alt + Arrow: Mova a janela activa para o monitor cuja direcção é indicada pela seta. Note que isto pode fazer com que a sua janela se mova para fora do ecrã se tentar subir a partir do monitor 2 ou directamente do monitor 3 na sua configuração. Irei actualizá-la no futuro.
Win + Alt + Number: Mova a janela activa para o número do monitor
#Persistent
SysGet, MonitorCount, MonitorCount
#!Up::
GoSub CalculateDisplacement
WinMove, A, , %xPos%, %displaceYneg%
return
#!Down::
GoSub CalculateDisplacement
WinMove, A, , %xPos%, %displaceYpos%
return
#!Left::
GoSub CalculateDisplacement
WinMove, A, , %displaceXneg%, %yPos%
return
#!Right::
GoSub CalculateDisplacement
WinMove, A, , %displaceXpos%, %yPos%
return
#!1::
GoSub CalculateDisplacement
WinMove, A, , %xPosOn1%, %yPosOn1%
return
#!2::
if (MonitorCount > 1) {
GoSub CalculateDisplacement
WinMove, A, , %xPosOn2%, %yPosOn2%
}
return
#!3::
if (MonitorCount > 2) {
GoSub CalculateDisplacement
WinMove, A, , %xPosOn3%, %yPosOn3%
}
return
#!4::
if (MonitorCount > 3) {
GoSub CalculateDisplacement
WinMove, A, , %xPosOn4%, %yPosOn4%
}
return
#!5::
if (MonitorCount > 4) {
GoSub CalculateDisplacement
WinMove, A, , %xPosOn5%, %yPosOn5%
}
return
#!6::
if (MonitorCount > 5) {
GoSub CalculateDisplacement
WinMove, A, , %xPosOn6%, %yPosOn6%
}
return
#!7::
if (MonitorCount > 6) {
GoSub CalculateDisplacement
WinMove, A, , %xPosOn7%, %yPosOn7%
}
return
#!8::
if (MonitorCount > 7) {
GoSub CalculateDisplacement
WinMove, A, , %xPosOn8%, %yPosOn8%
}
return
#!9::
if (MonitorCount > 8) {
GoSub CalculateDisplacement
WinMove, A, , %xPosOn9%, %yPosOn9%
}
return
CalculateDisplacement:
WinGetPos, xPos, yPos, , , A
Loop, %MonitorCount% {
SysGet, MonitorDimension, Monitor, %A_Index%
if (xPos > MonitorDimensionLeft and xPos < MonitorDimensionRight and yPos < MonitorDimensionBottom and yPos > MonitorDimensionTop) {
currentMonitor = %A_Index%
}
}
SysGet, thisMonitor, Monitor, %currentMonitor%
displaceXpos := xPos + thisMonitorRight - thisMonitorLeft
displaceYpos := yPos + thisMonitorTop - thisMonitorBottom
displaceXneg := xPos - thisMonitorRight + thisMonitorLeft
displaceYneg := yPos - thisMonitorTop + thisMonitorBottom
Loop, %MonitorCount% {
SysGet, nextMonitor, Monitor, %A_Index%
xPosOn%A_Index% := xPos - thisMonitorLeft + nextMonitorLeft
yPosOn%A_Index% := yPos - thisMonitorTop + nextMonitorTop
}
return