【问题标题】:French keyboard on macOS, altering the behavior of the tilde ~ keymacOS 上的法语键盘,改变波浪号 ~ 键的行为
【发布时间】:2020-07-17 04:38:06
【问题描述】:

像大多数法国用户一样,当我想去我的终端家时,我必须输入

cd ~

但是,键盘要求我按 options + n然后 space 以消除我尝试执行 ñ~ 之间的歧义。

有没有办法重载这种行为,因为我几乎不想像西班牙人那样使用波浪号?

Karabiner 看起来很有希望,但它不会让您定义自定义映射。它要求您在线选择一组预定义的。

【问题讨论】:

  • Karabiner 让您可以自己滚动,请参阅下面的示例。

标签: macos keyboard key-bindings french karabiner


【解决方案1】:

Ukelele 可以创建一个键盘变体,其中波浪号 ~ 不是死键,如果你可以让它在不挂起的情况下启动,这可能是你最好的选择。您始终可以通过按住 n 键一秒钟来输入 ñKarabiner-Elements、AppleScript 等只能输入您的键盘支持的内容,例如,这些带有 Karabiner 的 bash 命令:

cat > ~/.config/karabiner/assets/complex_modifications/azerty-tilde.json <<.
{"title": "AZERTY tilde",
 "rules": [
   {"description": "AZERTY tilde emits space after dead key ~ (option-n) for French keyboard.
Bug: auto-repeat gets only spaces after the initial tilde.",
    "manipulators": [
      {"type": "basic",
       "from": {"key_code": "n", "modifiers": {"mandatory": ["option"]}},
       "to": [{"key_code": "n", "modifiers": ["option"]},
              {"key_code": "spacebar"}]}]}]}
.

现在“AZERTY 波浪号”规则已安装。

Open -a Karabiner-Elements

选择此 Karabiner-Elements 菜单序列以启用“AZERTY 波浪号”规则:

Window > Karabiner-Elements Preferences > Complex Modifications > Rules > Add Rule

添加规则窗口中,找到左侧的“AZERTY 波浪号”,然后使用右侧对应的 ⊕ 启用 按钮。 现在每个死键波浪号后面都有一个空格。 “AZERTY 波浪号” ⊕ 删除  按钮将其禁用。 在 ns-option-modifier 设置为 none、FireFox、iTerm 和 Terminal 的 Emacs 中进行了测试。

【讨论】:

    猜你喜欢
    • 2015-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-24
    • 2015-11-17
    • 2023-03-28
    • 1970-01-01
    • 2012-03-08
    相关资源
    最近更新 更多