![“反向选择”的键盘快捷键](https://linux22.com/image/1462645/%E2%80%9C%E5%8F%8D%E5%90%91%E9%80%89%E6%8B%A9%E2%80%9D%E7%9A%84%E9%94%AE%E7%9B%98%E5%BF%AB%E6%8D%B7%E9%94%AE.png)
是否有专用于“反转选择”命令的 Windows 键盘快捷键?
答案1
答案2
另一种方法是为 shell 右键菜单添加注册表项,这也是我使用的。因此,当您选择文件或文件夹时,您只需右键单击它们,然后转到选择 > 反选。
将以下内容添加到 txt 文件,然后将其重命名为 .reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Select]
"SubCommands"="Windows.invertselection"
"Position"="middle"
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Select]
"SubCommands"="Windows.invertselection"
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\shell\Select]
"SubCommands"="Windows.invertselection"
"Position"="middle"
如果您愿意,可以通过向子命令添加更多选项来扩展它,但这完全取决于您。
答案3
使用 AutoHotKey (AHK v1) -
- 为了Windows 11 23H2Windows 文件资源管理器 -
#If WinActive("ahk_class CabinetWClass")
^i:: ; Ctrl + I
MouseMove 750, 150 ; see Note 1
Send {Click} ; click on "see more" option
WinWait, PopupHost ahk_class Microsoft.UI.Content.PopupWindowSiteBridge ahk_exe explorer.exe,, 1 ; 1s
If ErrorLevel ; if "see more" fails to open in 1 second
Return ; do nothing further
; Sleep 500 ; alternative to WinWait ; see Note 2
Send {Up 3} ; select "Invert selection" option
; Send {Enter} ; see Note 3
Return ; The end
; Note 1: location of "see more" option on screen
; MouseMove - move the mouse cursor to x,y coordinates on 'Screen'
; use Window Spy to determine coordinates for your own screen(s)
; might want to change "CoordMode" if you have problems, visit
; help page: https://www.autohotkey.com/docs/v1/lib/CoordMode.htm
; Note 2: wait 500ms for window to respond to keys
; wait times (in milliseconds) don't work sometimes,
; try changing them to see what is sufficient for your PC spec/performance.
; Sometimes it doesn't work at all on the 1st try
; (ex: when a new explorer instance is first opened after login/restart)
; but works on subsequent attempts. *shrug* no idea why.
; Note 3: uncomment this line after test of previous steps
; or leave it as is if you prefer to do this step manually,
; especially if you notice inconsistent selection of options.
#If
- 对于启用了功能区 UI 的文件资源管理器(在较旧的版本中)微软 Windows 11和 7/8/8.1/10 系统)-
; Source: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=27564
#If WinActive("ahk_class CabinetWClass")
^i:: ; Ctrl + I
ControlGet, hCtl, Hwnd,, SHELLDLL_DefView1, A
PostMessage, 0x111, 28706, 0,, % "ahk_id " hCtl ; edit, invert selection
return
#If