1

我正在尝试找到一种仅使用左侧选项键作为 osx 终端中的元键的方法,但将右侧选项保留为正常功能(特殊字符 #、@ 等)。

有没有办法配置它以这种方式工作?(基本上我想实现相同的功能,iterm 必须只使用一个选项作为元选项,另一个作为普通选项)

编辑:此外,也欢迎使用 Karabiner 的解决方案

4

3 回答 3

1

从 ant 的解决方案开始并在 Karabiner.app 包中挖掘以查看它是如何工作的,我找到了一种仅使用 Karabiner 使其工作的方法:

只需将您的 Karabiner private.xml(在 中找到~/Library/Application Support/Karabiner/private.xml)编辑为以下内容:

<?xml version="1.0"?>
<root>
  <appdef>
    <appname>TERMINAL</appname>
    <equal>com.apple.Terminal</equal>
  </appdef>

  <item>
    <name>Option-Left to Meta in Terminal</name>
    <only>TERMINAL</only>
    <identifier>private.optionltometa</identifier>
    <autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::VK_MODIFIER_EXTRA1</autogen>
    <include path="/Applications/Karabiner.app/Contents/Resources/include/checkbox/apps/terminal/meta_modifier_key.xml">
      <replacementdef>
        <replacementname>BEFORE</replacementname>
        <replacementvalue>KeyCode::ESCAPE</replacementvalue>
      </replacementdef>
      <replacementdef>
        <replacementname>AFTER</replacementname>
        <replacementvalue></replacementvalue>
      </replacementdef>
  </include>
</item>

</root>

然后启动 Karabiner 并按下Change Key选项卡中的Reload XML按钮(我使用的是 10.22.0 版本,可能在较新版本中选项卡名称已更改)

这种方法的优点是,当您不使用 Terminal 时,它不会禁用您的左选项键,就像使用 Seil 的解决方案一样。

于 2017-09-21T17:09:25.887 回答
1

它现在支持延迟“Option::KEYTOKEY_DELAYED_ACTION”

https://pqrs.org/osx/karabiner/xml.html.en#syntax-KeyToKey-options _ _

于 2016-09-19T02:29:29.333 回答
0

您应该能够结合使用SeilKarabiner来完成这项工作。首先,安装 Seil 并将 Option_L 键重新映射到键码 110,即 PC 应用程序键。然后在 Karabiner 中,展开For Applications树,然后仅在 Terminal 处启用,最后是Meta Modifier Key。选择PC Application Key to Meta Modifier Key in Terminal选项。

于 2016-03-16T17:22:15.443 回答