FuPeiJiang / VD.ahk

Windows Virtual Desktop, AutoHotkey, Windows 11 support, Windows Server 2022, switch desktop, move window(wintitle) to current desktop; createDesktop, PinWindow, getCount, getDesktopNumOfWindow -> mute all windows in Virtual Desktop
MIT License
319 stars 45 forks source link

It doesn't work on Windows 11 Build 22631.3085 (23H2) #65

Open vlachig opened 5 months ago

vlachig commented 5 months ago

Can someone fix it? I'm using AutoHotkey v1.

Thanks!

Katsuyamaki commented 5 months ago

Hello - doesn't work for me either.

Im using 22631 and AHv1.

When I run the example/tutorial and I press F1/F2/F6 it just tells me zero desktops.

Pressing numberpad doesn't do anything.

vlachig commented 5 months ago

@Katsuyamaki, try this Update https://github.com/FuPeiJiang/VD.ahk/pull/62/commits/1d9a94ef8ef87a4fc6d2cb5f83b6d068302a03d9

Katsuyamaki commented 5 months ago

@Katsuyamaki, try this Update 1d9a94e

Thank you, this seemed to work!

Question though, it only works if I launch VD examples ahk. Is that right? I woulda thought it would be VD.ahk or _VD that I need to launch?

Not really an issue if I just launch VD examples though, but strange.

vlachig commented 5 months ago

_VD.ahk is a library. You can include it in your main script. Or use VD examples.ahk as your main script. You can add more stuff to it (hotkeys, hotstrings, timers etc.)

lscobe16 commented 5 months ago

The changes applied at the respective locations in the AHKv2 versions do also fix the issue there. Thanks!

Katsuyamaki commented 5 months ago

Thank you @lscobe16 and @vlachig - I was able to download that updated code and it worked.

How do I use the library? Do I just copy over the parts of the scripts I want from the library to my VD example.ahk script to get those parts to work? I always need the _VH.ahk script in the same folder as my example.ahk script right? I can't combine them together without more editing? (Although I understand I can rename the example.ahk if I want or just pull the contents of example.ahk to any other script I want.)

lscobe16 commented 5 months ago

The example.ahk is an example of such a script, that uses the library. It imports it using #Include %A_LineFile%\..\VD.ahk and calls its functions, e.g. using VD.goToDesktopNum(1). You can do the same in any other script (of course using the respective relative include path). For further general questions regarding usage, please refer to the README or create a separate issue.

generis-it commented 5 months ago

Having the same issue with AHK V2. Could anyone adapt the fix for V2 as well, please.

lscobe16 commented 5 months ago

@generis-it Just look at the diff and search the hexadecimal codes and replace them accordingly.

lscobe16 commented 5 months ago

fix.patch

This patch contains all fixes I needed for the current and the last versions of Windows 11 with AHK2. See here on how to apply it. Feel free to include these in pull requests.

Credit goes to @machaus for the first fix and to @vlachig's comment above for the second one.

miserton commented 5 months ago

@lscobe16's patch solved this and is a quick way to fix the ahk2 version. One issue some may face is that the patch is encoded with UTE-16 and git may have issues unless it is UTE-8. If you have that problem, just open it with Notepad++ and save as UTE-8 and convert the EOL to Unix. Or you can install it all from bash:

git clone -b v2_port https://github.com/FuPeiJiang/VD.ahk.git cd vd.ahk wget https://github.com/FuPeiJiang/VD.ahk/files/14130744/fix.patch iconv -f UTF-16 -t UTF-8 fix.patch | tr -d '\r' > fix_converted.patch git apply fix_converted.patch

Stan-Stani commented 4 months ago

I used VSCode to convert to UTF-8. Applying the patch complained about one whitespace error added, but that didn't prevent it from fixing the issue. I think that error is literally just about trailing whitespace etc. now being present.

Viqsi commented 4 months ago

Can't speak to AHKv1 specifically, but from my own testing AHKv2 appears to have been recently fixed with 02f37bf (committed three weeks ago), and the AHKv1 equivalent 77a66c9 is also available. So we may be all good thanks to @FuPeiJiang's hard work now. I strongly suggest testing it as it means this issue may be fixed. 👍