如何更改Windows 10或Windows 11中虛擬桌面之間切換的快速鍵?

如何更改Windows 10或Windows 11中虛擬桌面之間切換的快速鍵?

在 Linux 中,我使用快捷方式在 4 個工作區之間切換:win+ 1/2/3/4

我希望在 Windows 10 或 Windows 11 中擁有類似的功能。

更新解決方案

  1. (Windows 11 不需要此步驟 - 僅適用於 Window10 使用者)透過此更新您的 Windows 版本到最新版本 更新程式。您可能還需要適用於 Visual Studio 2015 的 Visual C++ 可重複發行元件
  2. 下載並解壓縮這個Windows 10 虛擬桌面增強器(0.9.1) 對我有用。
  3. 將文件settings.ini的內容改為
[KeyboardShortcuts]
Switch=LWin
Move=LAlt, Shift, Ctrl
MoveAndSwitch=LAlt, Shift
Previous=Left
Next=Right
PlusTen=
  1. (僅限Windows 11用戶)替換虛擬桌面存取器.dll文件來自https://github.com/skottmckay/VirtualDesktopAccessor/tree/master/x64/Release

  2. 跑步虛擬桌面增強器.exe作為行政人員

  3. 使用快捷鍵win+ 1/2/3/n(其中n是您建立的虛擬桌面的數量),可以直接在虛擬桌面之間切換, win+`~可以實現「暴露」效果。

答案1

您需要的內容如下:

  • 捕捉視窗: WIN+LEFT或(可與或 一起RIGHT 使用以進入象限)UPDOWN
  • 切換到最近的視窗: Alt+ Tab(不變)- 按住顯示新的任務視圖視窗視圖,放開並切換到應用程式。
  • 任務檢視: WIN+ Tab– 新任務檢視開啟並保持開啟。
  • 建立新的虛擬桌面: WIN+ Ctrl+d
  • 關閉目前虛擬桌面: WIN+ Ctrl+F4
  • 切換虛擬桌面: WIN+ Ctrl+LEFTRIGHT

答案2

我想我剛剛構建了您正在尋找的東西。我在 Linux 上使用視窗管理器,並希望在 Windows 上以類似的方式使用熱鍵。

https://github.com/pmb6tz/windows-desktop-switcher

我的腳本使用 CapsLock 因為它對我來說更方便,但您可以輕鬆配置它以適合您。其中可能有一兩個錯誤,但總的來說我發現它非常可靠。希望這可以幫助你!

答案3

我剛剛做了一個腳本自動熱鍵可以在 Windows 10 中為最多 10 個桌面實現此目的。

如何讓它工作:

下載並安裝自動熱鍵。將以下程式碼複製並貼上到記事本中,並使用檔案副檔名 .ahk 儲存

我建議在啟動資料夾中建立此文件的快捷方式,以便它在 Windows 啟動時運行。

預設熱鍵:

切換桌面:WIN+桌上號(0=桌上號10)

新桌面:CTRL+WIN+D

關閉桌面:CTRL+WIN+F4

顯示桌面狀態:WIN+'

重要的:

為了使其工作,您必須僅使用熱鍵來開啟、關閉和變更桌面,因為腳本會偵聽這些熱鍵以了解桌面的當前數量和總數。

如果您確實使用滑鼠透過 WIN+TAB 選單建立、關閉或變更桌面,則腳本將停止運作。為了讓它再次工作,您需要編輯前兩行以反映桌面的當前狀態。 (桌面計數/目前桌面)

這並不意味著您不能使用 WIN+TAB 螢幕作為目前桌面的概覽。實際上,您可以將它與熱鍵結合使用來組織您的桌面。是的,當 Windows 任務檢視器開啟時,熱鍵仍然有效! (WIN+TAB) 只是不要使用滑鼠!

另外,在建立新桌面之前,請等待 Windows 啟動後載入腳本,否則它將無法運作。這可能需要一些時間,具體取決於您有多少啟動程序。

好的,我又添加了一件事,以便更輕鬆地將腳本與桌面狀態重新同步。現在有一個熱鍵可以顯示腳本認為桌面所處的狀態,因此您所要做的就是用滑鼠調整桌面以適應腳本,然後一切都會再次同步!對於使用瑞士鍵盤的我來說,帶有“?”效果很好。 0 旁邊的鍵,有 ? 才有意義但在其他鍵盤上,您可能想要更改此設置,這可以透過將 0/10 熱鍵(以 #' 開頭)後面的行更改為您喜歡的任何內容來輕鬆完成。

實際上,我剛剛意識到......只要桌面計數正確,創建新桌面就會自動重新同步當前桌面值。

(以 ; 開頭的行是註釋,不影響腳本)

代碼:

#NoTrayIcon
;If the script stops working:
;Change the following values to reflect your current desktop state and reload the script.
;Remember to change them back to 1 after reloading the script if you have it set to start with Windows

desktopcount := 1
currentdesktop := 1

;You can change the hotkeys for creating, closing, and switching desktops bellow.
;The current hotkeys are CTRL+WIN+D for new desktop, CTRL+WIN+F4 to close desktop
;and WIN+NUMBER for switching desktops.
;For example, to change the hotkey for new desktop replace ^#D bellow with the desired hotkey.
;Refer to the autohotkey documentation for a full list of symbols refering to modifier keys,
;as you can see ^ is CTRL and # is WIN key.
;If you wanted to change the switch desktop from WIN key to CTRL for example you would have
;to replace the # before each number to a ^

^#D::NewDesktop()
^#F4::CloseDesktop()
#1::SwitchDesktop(1)
#2::SwitchDesktop(2)
#3::SwitchDesktop(3)
#4::SwitchDesktop(4)
#5::SwitchDesktop(5)
#6::SwitchDesktop(6)
#7::SwitchDesktop(7)
#8::SwitchDesktop(8)
#9::SwitchDesktop(9)
#0::SwitchDesktop(10)
#'::MsgBox Desktop Count = %desktopcount%`nCurrent Desktop = %currentdesktop%

;Do not change anything after this line, unless you know what you are doing ;)
;-----------------------------------------------------------------------------------------------
SwitchDesktop(desktop)
{

    global desktopcount
    global currentdesktop
    desktopdiff := desktop - currentdesktop
    if (desktop > desktopcount)
    {
        return
    }
    if (desktopdiff < 0)
    {
        desktopdiff *= -1
        Loop %desktopdiff%
        {
        Send ^#{Left}
        }   
    }
    else if (desktopdiff > 0)
    {
        Loop %desktopdiff%
        {
        Send ^#{Right}
        }
    }
    currentdesktop := desktop
}

NewDesktop()
{
    global desktopcount
    global currentdesktop
    if (desktopcount > 9)
    {
        return
    }
    desktopcount ++
    currentdesktop := desktopcount
    Send ^#d
}

CloseDesktop()
{
    global desktopcount
    global currentdesktop
    desktopcount --
    if (currentdesktop != 1)
    {
        currentdesktop --
    }
    Send ^#{f4}
}

答案4

例如,我想為下一個桌面設定 Page Down,為上一個桌面設定 Page Up 在我安裝 AutoHotkey 後,我建立一個新的 AutoHotKey 腳本並向其中新增此程式碼並儲存,然後執行腳本

PgDn::^#Right ;Next Desktop
return 

PgUp::^#Left ;Previous Desktop
return 

效果會很好:)

更新:有時上面的程式碼不起作用,您必須單擊某個點。

PgDn::
   {
      MouseGetPos,,,win
      WinGetClass, class, ahk_id %win%
      If class in Progman,WorkerW
         send {Click}^#{Right}  
      else
         send ^#{Right}  ; Next  Desktop  
      return
    }

PgUp::
    {
       MouseGetPos,,,win
       WinGetClass, class, ahk_id %win%
       If class in Progman,WorkerW
          send {Click}^#{Left}
       else
          send ^#{Left}  ; Previous Desktop  
       return
    }

相關內容