【问题标题】:Conkeror Keybindings on Mac OSXMac OSX 上的 Conkeror 键绑定
【发布时间】:2010-02-04 07:00:25
【问题描述】:

有人知道如何在 Mac OSX 上更改 Conkeror 的元键和控制键的键绑定吗?例如,在 Emacs 中,我将 C 映射到苹果命令键,将 M 映射到选项键。有没有办法为 Conkeror 做到这一点?任何人都可以提供 .conkerorrc 文件的 javascript 吗?

【问题讨论】:

    标签: emacs macos key-bindings conkeror


    【解决方案1】:

    您必须稍微摆弄一下才能使其完全符合您的要求,但作为示例...将 C 重新绑定到 M

    modifiers.C = new modifier(
      function (event) { return event.metaKey; },
      function (event) { event.metaKey = true; });
    

    您需要做的就是用 M 或 A 或 S 分别替换 Meta、Alt 和 Super 的 C。然后将 metaKey 替换为您想要的密钥。我不确定 Command 键会产生什么,所以你必须摆弄它,但我很确定该选项是 Alt,这样就可以了

    modifiers.M = new modifier(
      function (event) { return event.altKey; },
      function (event) { event.altKey = true; });
    

    有趣的是,在除 OS X 之外的所有系统上,Conkeror 默认将 Meta 和 Alt 视为相同。

    编辑实际上它看起来比我一开始说的要复杂。你应该阅读the Conkeror wiki page about it

    【讨论】:

      【解决方案2】:

      安装KeyRemap4MacBook

      把这个放在你的.conkerorrc

      modifiers.C = new modifier(
        function (event) { return event.metaKey; },
        function (event) { event.metaKey = true; });
      modifiers.M = new modifier(
        function (event) { return event.ctrlKey; },
        function (event) { event.ctrlKey = true; });
      

      把这个放到~/Library/Application Support/KeyRemap4MacBook/private.xml

      <?xml version="1.0"?>
      <root>
        <appdef>
          <appname>CONKEROR</appname>
          <equal>org.mozdev.conkeror</equal>
        </appdef>
        <item>
          <name>Enable only in Conkeror</name>
          <item>
            <name>Option_L to Control_L</name>
            <identifier>private.app_cokeror_option_l_to_control_l</identifier>
            <only>CONKEROR</only>
            <autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::CONTROL_L</autogen>
          </item>
          <item>
            <name>Option_R to Control_R</name>
            <identifier>private.app_conkeror_option_r_to_control_r</identifier>
            <only>CONKEROR</only>
            <autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::CONTROL_R</autogen>
          </item>
        </item>
      </root>
      

      启动 KeyRemap4MacBook 并选中“仅在 Conkeror 中启用”下的两个框。

      你应该发现 cmdM-altC-

      cmd 变成M- 是直截了当的——这是.conkerorrc 的前三行。将 alt 变成 C- 并不简单,因为 Conkeror 无法检测到在 OS X 中何时按下 alt 键。这就是为什么我告诉 Conkeror 监听 ctrl 按键,然后安装 KeyRemap4MacBook 以假装 alt 键实际上是 ctrl 键,但仅适用于 Conkeror。自然,这意味着 ctrlalt 都是M-。除非您真的想将 ctrl 键用于其他用途,否则这应该不是问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-09-14
        • 2011-01-15
        • 1970-01-01
        • 1970-01-01
        • 2012-12-30
        相关资源
        最近更新 更多