Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not work for win10 22h2 19045.4780 #72

Open
halfmanli opened this issue Aug 23, 2024 · 1 comment
Open

Not work for win10 22h2 19045.4780 #72

halfmanli opened this issue Aug 23, 2024 · 1 comment

Comments

@halfmanli
Copy link

I use the following code to move the current window to another virtual desktop, but it does not work.

#Include %A_LineFile%\..\_VD.ahk
^#!Left::
n := VD.getCurrentDesktopNum()
if n = 1
{
    Return
}
n -= 1
VD.MoveWindowToDesktopNum("A",n), VD.goToDesktopNum(n)
Return

^#!Right::
n := VD.getCurrentDesktopNum()
if n = % VD.getCount()
{
    Return
}
n += 1
VD.MoveWindowToDesktopNum("A",n), VD.goToDesktopNum(n)
Return

My OS is win10, whose version is 22H2 and the build number is 19045.4780.
I appreciate your help!

@FuPeiJiang
Copy link
Owner

;include the library
#Include %A_LineFile%\..\VD.ahk
; or
; #Include %A_LineFile%\..\_VD.ahk
; ...{startup code}
; VD.init()

; move window to left and follow it
^#!left::VD.goToDesktopNum(VD.MoveWindowToRelativeDesktopNum("A", -1))
; move window to right and follow it
^#!right::VD.goToDesktopNum(VD.MoveWindowToRelativeDesktopNum("A", 1))
#Include %A_LineFile%\..\_VD.ahk
VD.init()
^#!Left::
n := VD.getCurrentDesktopNum()
if n = 1
{
    Return
}
n -= 1
VD.MoveWindowToDesktopNum("A",n), VD.goToDesktopNum(n)
Return

^#!Right::
n := VD.getCurrentDesktopNum()
if n = % VD.getCount()
{
    Return
}
n += 1
VD.MoveWindowToDesktopNum("A",n), VD.goToDesktopNum(n)
Return

I'll remove _VD.ahk very soon enough since it leads to confusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants