AHK-Virtual-Desktop-Library
AHK-Virtual-Desktop-Library copied to clipboard
Request: "Move windows to next/previous desktop"
Great work here firstly - appreciate your sharing it.
The "move window to desktop number <X>" is awesome, but I wonder if it would be possible to add "move to next/previous vd". This would match the "move to next/previous monitor" hotkeys already present natively in Windows ( and would help me switch between mac/win everyday as I have to for work! )
Thanks again.
Any tips on how I may implement this myself without needing to add another function on your part would also be appreciated!!
Hi!
Put your best to understand it, and then feel free to ask me anything you don't get Btw I stopped coding and now im returning(sorry for the late response), so i'm pretty sure there's something wrong with the grammar, I forgot stuff So this is how I would do:
MoveCurrentWindowToNextDesktop(){
currentDesktop := GetCurrentDesktop()
nextDesktop := currentDesktop + 1
amountOfDesktops := GetAmountOfDesktops()
if nextDesktop =< amountOfDesktops
MoveCurrentWindowToDesktop(nextDesktop)
else
msgbox, theres not a next desktop
}
MoveCurrentWindowToPrevDesktop(){
currentDesktop := GetCurrentDesktop()
prevDesktop := currentDesktop - 1
if prevDesktop <= 1
msgbox, theres not a previous desktop
else
MoveCurrentWindowToDesktop(prevDesktop)
}
If you make it work, share your code here so everyone can see it(including me because i'm curious)