如何仅禁用某些 Windows 10 全局快捷方式以在第三方应用程序中使用它们?

Саш*_*ных 13 windows keyboard-shortcuts autohotkey sublime-text-3 windows-10

1. 简要

我只想禁用一些 Windows 10 默认全局热键,以使用此热键运行 Sublime Text 命令。



2. 细节

我有 Windows 32 位 10.0.14393。在 Windows 10 中,我们有许多本机热键

1.我想禁用

例如,我想禁用自定义热键Win+KWin+HCtrl+Win+P

2.我不想禁用

但是,例如,我不想禁用Win+DWin+R热键。我经常使用这些热键。

3. Sublime Text 键盘映射部分

{
    "keys": ["super+k"],
    "command": "paste"
},
Run Code Online (Sandbox Code Playgroud)

3.没有帮助

1.自动热键覆盖

我的代码:

#k::return
Run Code Online (Sandbox Code Playgroud)

Win+K global hotkey is disabled for me, but my Sublime Text command paste doesn't run too.

2. AutoHotkey overwrite global Windows hotkeys to hotkey of application

My code:

#IfWinActive ahk_class PX_WINDOW_CLASS
$#2::ControlSend, ahk_parent, % SubStr(A_ThisHotkey, 2)
#IfWinActive
Run Code Online (Sandbox Code Playgroud)

It is worked for me, but I have bugs, for example:

自动热键错误

For other hotkeys I have bugs too. It would be nice if someone will improve this code.

3. SharpKeys

SharpKeys program can disable or reassign Win key, but I don't want this.

4. gpedit.msc

I can disable some default hotkeys, but:

  • I can not disable (using gpedit.msc), for example, Win+K, Win+H and Ctrl+Win+P.
  • I can disable Win+D and Win+R, but I want to use this hotkeys.

5. Simple disable key

我下载简单的禁用键?我Win+K在程序中禁用?我重新启动Windows?Win+K对我来说没有禁用。

6. Windows 注册表中的 DisabledHotkeys 参数

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
Run Code Online (Sandbox Code Playgroud)

DisableHotkeys用 value创建字符串参数KHPE

禁用热键

Win+E例如,对我来说是禁用的,但是

  • Win+PWin+K并且Win+H没有被禁用。
  • 例如,此方法不适用于禁用Ctrl+Win+PCtrl+Win+F4


4. 不提供

Bla*_*ght 4

您可以使用 Autohotkey 重新映射任何热键,以使用Send命令发送另一个热键:

#k::
Send {WIN up}
Send {k up}
Send ^+p
return
Run Code Online (Sandbox Code Playgroud)

之后按 Win+K 将发送一个 Ctrl+Shift+P,它将在 Sublime Text 中显示命令面板,您可以使用这种方式覆盖任何热键以发送另一个热键,将其设置为 Ctrl+Shift+F3 之类的内容并分配该热键Sublime Text 的粘贴热键(在键绑定中),然后使用 Win+K 将 Ctrl+Shift+F3 发送到 Sublime Text,这将调用粘贴。

自动热键脚本:

#k::
Send {WIN up}
Send {K up}
Send !^+{F3}
return
Run Code Online (Sandbox Code Playgroud)

Sublime Text 按键绑定:

{ "keys": ["ctrl+alt+shift+f3"], "command": "paste" }
Run Code Online (Sandbox Code Playgroud)

编辑

看到你的Please, don't offer AutoHotkey shortcuts redirect to other shortcuts.为什么不呢?上面的示例甚至适用于 Win+R:

#r::
Send {WIN up}
Send {r up}
Send !^+{F3}
return
Run Code Online (Sandbox Code Playgroud)

在 Sublime Text 中通过 Win+R 成功粘贴文本。

编辑2

如果您确实喜欢分配真正的热键,您可以禁用所有Win+{KEY}热键,然后创建与默认热键相同的热键Win+{Key}并为另一个热键分配您自己的操作。

以 Win+R 为例:

explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}
Run Code Online (Sandbox Code Playgroud)

有效,但对于某些热键来说,很难找到如何调用它们的操作。