【发布时间】:2016-01-18 22:36:53
【问题描述】:
我正在尝试找到一种方法,在 osx 终端中仅使用左侧选项键作为元键,但将右侧选项保留为正常功能(特殊字符 #、@ 等)。
有没有办法配置它以这种方式工作? (基本上,我想实现与 iterm 相同的功能,只需将一个选项用作元选项,将另一个选项用作普通选项)
编辑:另外,也欢迎使用 Karabiner 的解决方案
【问题讨论】:
我正在尝试找到一种方法,在 osx 终端中仅使用左侧选项键作为元键,但将右侧选项保留为正常功能(特殊字符 #、@ 等)。
有没有办法配置它以这种方式工作? (基本上,我想实现与 iterm 相同的功能,只需将一个选项用作元选项,将另一个选项用作普通选项)
编辑:另外,也欢迎使用 Karabiner 的解决方案
【问题讨论】:
现在支持延迟 "Option::KEYTOKEY_DELAYED_ACTION"
https://pqrs.org/osx/karabiner/xml.html.en#syntax-KeyToKey-options
【讨论】:
从 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 版本,可能新版本中的选项卡名称已更改)
这种方法的优点是它不会像使用 Seil 的解决方案那样在不使用终端时禁用左选项键。
【讨论】:
【讨论】: