有没有办法将 tab 键映射到 emacs 中的元?

发布于 2024-12-25 14:39:48 字数 140 浏览 5 评论 0原文

我希望将 Meta 重新绑定到我的 emacs 环境中的 tab 键。我环顾四周,但除了将其绑定到 commandoption 之外找不到任何其他东西,它们稍微好一点,但仍然不理想。

I'm looking to rebind Meta to the tab key in my emacs environment. I've looked around but been unable to find anything other than binding it to command or option, which are slightly better but still not ideal.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆流 2025-01-01 14:39:48

您无法单独在 Emacs 中执行此操作,您需要修改窗口系统(*nux、Mac、MS Windows)中的键盘映射。

请参阅类似问题的推理: Mapping Caps Lock to在 Windows 上的 Emacs 中进行控制elisp 如何检查 Shift 键是否被按下,以及 < a href="https://stackoverflow.com/questions/1043073/can-i-send-a-shift-keypress-to-windows-from-emacs">我可以将按键发送到 Windows Emacs?。

可以在窗口系统中进行更改 - 但了解那是什么会很有帮助......

You cannot do this in Emacs alone, you need to modify the keymap in your window system (*nux, Mac, MS Windows).

See the similar questions for the reasoning: Mapping Caps Lock to Control from within Emacs on Windows, elisp how to check if Shift key is pressed, and Can I send a keypress to Windows from Emacs?.

You can make the change in your window system - but it'd be helpful to know what that is...

撕心裂肺的伤痛 2025-01-01 14:39:48

如果您使用 OS X,则可以安装 KeyRemap4MacBook 并使用 private.xml ,例如this:

<?xml version="1.0"?>
<root>
  <appdef>
    <appname>EMACS</appname>
    <equal>org.gnu.Emacs</equal>
  </appdef>
  <item>
    <name>tabtometa</name>
    <identifier>tabtometa</identifier>
    <only>EMACS</only>
    <autogen>__KeyOverlaidModifier__ KeyCode::TAB, KeyCode::OPTION_L, KeyCode::TAB</autogen>
  </item>
</root>

按住时将选项卡更改为选项,但按下时将其保留为选项卡。

如果您想使用选项插入非 ASCII 字符,请将 OPTION_L 更改为 CONTROL_R 并使用:

(setq ns-option-modifier 'nil)
(setq ns-right-control-modifier 'meta)

If you use OS X, you can install KeyRemap4MacBook and use a private.xml like this:

<?xml version="1.0"?>
<root>
  <appdef>
    <appname>EMACS</appname>
    <equal>org.gnu.Emacs</equal>
  </appdef>
  <item>
    <name>tabtometa</name>
    <identifier>tabtometa</identifier>
    <only>EMACS</only>
    <autogen>__KeyOverlaidModifier__ KeyCode::TAB, KeyCode::OPTION_L, KeyCode::TAB</autogen>
  </item>
</root>

It changes tab to option when held but keeps it as tab when pressed.

If you want to use option to insert non-ASCII characters, change OPTION_L to CONTROL_R and use:

(setq ns-option-modifier 'nil)
(setq ns-right-control-modifier 'meta)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文