[Windows 10] Switch to different virtual desktop on Win+{1,9}

Post your working scripts, libraries and tools for AHK v1.1 and older
m0b-ua
Posts: 12
Joined: 31 Aug 2016, 06:35

Re: [Windows 10] Switch to different virtual desktop on Win+{1,9}

27 Jun 2017, 09:49

m0b-ua wrote:The script shoud activate last window after switching. I fix it by adding "Send !{Tab}" to the end of "switchToDesktop" function, but i think there is a better way to fix the issue.
"Send !{Tab}" is buggy, maybe someone will suggest a better way?
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
Contact:

Re: [Windows 10] Switch to different virtual desktop on Win+{1,9}

02 Jul 2017, 17:29

m0b-ua wrote:The script shoud activate last window after switching. I fix it by adding "Send !{Tab}" to the end of "switchToDesktop" function, but i think there is a better way to fix the issue.
No, it shouldn't. It does its job of asking Explorer to switch desktops. What Explorer does after that isn't my concern ^-^
m0b-ua wrote:"Send !{Tab}" is buggy, maybe someone will suggest a better way?
I haven't tested how useful this function actually is, but you can try WinActivate % "ahk_id " . GetTaskbarVisibleWindows(1)[1]

(Also, this script is shit)
m0b-ua
Posts: 12
Joined: 31 Aug 2016, 06:35

Re: [Windows 10] Switch to different virtual desktop on Win+{1,9}

03 Jul 2017, 01:36

qwerty12 wrote:I haven't tested how useful this function actually is, but you can try WinActivate % "ahk_id " . GetTaskbarVisibleWindows(1)[1]
It's working, tnx! It still don't work on fast switch, but i hope I'll get rid of ctrl and alt stuck on pressed position!
dooley2009
Posts: 1
Joined: 13 Aug 2017, 01:26

Re: [Windows 10] Switch to different virtual desktop on Win+{1,9}

13 Aug 2017, 01:37

Code: Select all

#SingleInstance Force
#MaxThreads, 1
SetKeyDelay, 50

;*********MOVE TO RIGHT VIRTUAL DESKTOP*********
	
	~LAlt & D::
		While (GetKeyState("LAlt","P") && GetKeyState("D","P")) {
			Send {LWin Down}{Tab}      
			Send {LCtrl Down}{Right Down}
			Send {LWin Up}{LCtrl Up}{Right Up} 
			Send {Enter}
			}
		Return

;*********MOVE TO LEFT VIRTUAL DESKTOP*********
	
	~LAlt & A::
		While (GetKeyState("LAlt","P") && GetKeyState("A","P")) {
			Send {LWin Down}{Tab}     
			Send {LCtrl Down}{Left Down}
			Send {LWin Up}{LCtrl Up}{Left Up} 
			Send {Enter}
			}
		Return
The endless struggle to solve the shortcoming's of Windows.
Fez
Posts: 1
Joined: 15 Nov 2017, 14:17

Re: [Windows 10] Switch to different virtual desktop on Win+{1,9}

15 Nov 2017, 14:22

I've been loving this script, any way you could add support for Virtual Desktop 10-19 via Numpad0-9? Would've been very much appreciated!
GreatGazoo
Posts: 69
Joined: 28 Dec 2017, 02:53

Re: [Windows 10] Switch to different virtual desktop on Win+{1,9}

26 Jan 2018, 03:25

Snapping window: WIN+LEFT or RIGHT (can be used with UP or DOWN to get into quadrants)
Switch to recent window: Alt+Tab (unchanged) – Hold shows new Task view window view, let go and switches to app.
Task view: WIN+Tab – New Task view opens up and stays open.
Create new virtual desktop: WIN+Ctrl+d
Close current virtual desktop: WIN+Ctrl+F4
Switch virtual desktop: WIN+Ctrl+LEFT or RIGHT

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 95 guests