Skip to content

Commit

Permalink
经测试, cur_active_window_X 会比真实的数据少一些, 所以我们加上22来补偿
Browse files Browse the repository at this point in the history
  • Loading branch information
no5ix committed Oct 24, 2021
1 parent 4386f43 commit cd1ddd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions source/action.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,19 @@ GotoPreApp() {
}

JumpToPrevTab() {
if (!IsMouseActiveWindowAtSameMonitor())
if (!IsMouseActiveWindowAtSameMonitor()) {
ActivateWindowsUnderCursor()
}
Send {LControl Down}{LShift Down}
Send, {Tab}
Sleep, 111
Send {LControl Up}{LShift Up}
}

JumpToNextTab() {
if (!IsMouseActiveWindowAtSameMonitor())
if (!IsMouseActiveWindowAtSameMonitor()) {
ActivateWindowsUnderCursor()
}
Send {LControl Down}
Send, {Tab}
Sleep, 111
Expand Down
3 changes: 2 additions & 1 deletion source/util.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,13 @@ ActivateWindowsUnderCursor() {
IsMouseActiveWindowAtSameMonitor(cur_active_window_X="") {
if (cur_active_window_X == "") {
WinGetPos, cur_active_window_X, cur_active_window_Y,,, A
tt(cur_active_window_X "//" cur_active_window_Y)
}
MouseGetPos, Mouse_x, Mouse_y ; Function MouseGetPos retrieves the current position of the mouse cursor
; m(cur_active_window_X "//" mouse_X)
; MsgBox, The Mouse_ is at %Mouse_x%`,%Mouse_y%
; MsgBox, The active window is at %cur_active_window_X%`,%cur_active_window_Y%
real_cur_active_window_X := cur_active_window_X + 8 ; 经测试, 实际上全屏后也总是会加8
real_cur_active_window_X := cur_active_window_X + 22 ; 经测试, cur_active_window_X 会比真实的数据少一些, 所以我们加上22来补偿
SysGet, mon_cnt, MonitorCount
Loop, % mon_cnt
{
Expand Down

0 comments on commit cd1ddd3

Please sign in to comment.