如果修改键已关闭,如何禁用键盘重映射?

时间:2013-01-15 19:49:50

标签: autohotkey

我正在使用不同的键盘布局,使用AHK的qwerty来制作colemak脚本。它将字母重新映射到不同的字母。当ctrl,alt或windows键关闭时,如何禁用它。这样保存的热键如ctrl + s仍然有效!

编辑:我从这里获得了脚本http://colemak.com/wiki/index.php?title=Download

它看起来像这样

r::p
t::g
y::j
u::l

4 个答案:

答案 0 :(得分:3)

使用Suspend禁用热键。 使用~告诉AHK不要阻止本机事件。 然后再次使用Suspend重新启用热键。

~Ctrl::Suspend, On
~Ctrl Up::Suspend, Off

~Alt::Suspend, On
~Alt Up::Suspend, Off

~LWin::Suspend, On
~LWin Up::Suspend, Off

答案 1 :(得分:2)

虽然我在上面的评论中写道,我认为不需要这种条件禁用,但这里有一些代码。我用了字母f并在记事本中测试过。 按f返回Hello 按^ f应该给hELLO,但由于#IF不正确,因为系统发送常规的Ctrl + f,打开记事本查找。 对于!f,这将打开“文件”菜单。 警告你必须安装autoHotKey_L才能使#IF正常工作!

#If (NOT ((GetKeyState("Control", "P")) OR (GetKeyState("Alt", "P"))))
    f::Send, Hello ; Should execute as long as Ctrl or Alt are not pressed.
    *a::Send, QQQQ ; The * ignores all modyfiers, not executed when Alt or Ctrl is pressed.
    ^f::Send, hELLO ; should never execute due to #IF = False
    !f::Send, olleh ; should never execute due to #IF = False
#IF

答案 2 :(得分:0)


包括脚本的代码或提供脚本的链接(我自己搜索但找不到它)会有所帮助。

如果脚本中的重新映射已正确完成,则组合 Ctrl + S 仍应有效,但键的物理位置已更改。正如我在布局中看到的那样 http://colemak.com/wiki/images/8/80/Colemak_layout_2.png
s离原版s不远,所以你可以试着记住它。



禁用热键的常用解决方案是:

    Suspend, On

http://www.autohotkey.com/docs/commands/Suspend.htm

由于我没有看到脚本,我不知道它是否会起作用。

答案 3 :(得分:0)

与上述相同。不确定脚本。一个想法可能是使用autoHotKey_L #if函数并将重新分配的键放在#IF内。然后应该在未按下的修改键周围创建#IF。