日版Macbook程序员Karabiner软件键盘映射


前言

最近搞了台Macbook Pro 为了便宜买了日版 回来发现日文键盘和原来国内不一样,决定打造一下键位映射方便Code!


一、键位映射思路

  • 痛点:高频 = ,日版 Mac 你得shift + = 才能敲出 =
  • 痛点:高频 {} ,日版 Mac 你得shift + { 才能敲出 { 当然国行也是这样

以上问题还有 \ 反斜杠 、顿号和 _下划线不好找

我尽量将高频键一个键直接按出来,方便Code!

二、安装软件

  • 官网地址
    进去点击Download直接进行下载
    在这里插入图片描述

  • 下载下来两个点击左边那个 进去将权限全部授予好

三、普通键位映射

  • 由于日版 英数键 和 かな键盘 (空格左右) 我分别映射大小写转换
    在这里插入图片描述

四、自定义映射

  • 点击图纸Add your own rule点击save
    在这里插入图片描述

  • 自定义规则讲解(这个配置文件JSON格式)

{
    "description": "@映射",
    "manipulators": [
        {
            "from": {
                "key_code": "open_bracket",
                "modifiers": {
                    "mandatory": [
                        "right_shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "2",
                    "modifiers": [
                        "right_shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 重点Form To
  • Form块里的按下哪些组合键
  • To块里Form按下组合键产生效果
    上边意思 right_shift + open_bracket 等效与right_shift + 2
  • 上述多个键映射多个键
  • 一个键映射多个键盘 在Form取消mandatory块就行
  • 多个键映射一个键 在To取消modifiers块就行
  • optional块主要防止切换大写键位映射失效
    你想细致了解每个配置项意思可以参考官方文档
  • 你想知道你按下去键的key_code叫啥打开这个

在这里插入图片描述在这里插入图片描述

我的键盘映射JSON配置文件

❗他这个直接修改类似于国内布局导致键盘符号和输出符号不一致所以要映射很多

  • 下划线映射 _
{
    "description": "下划线映射 _",
    "manipulators": [
        {
            "from": {
                "key_code": "japanese_kana",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "hyphen",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 竖线和反斜杠号映射 | \
{
    "description": "竖线和反斜杠号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "international3",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "backslash",
                    "modifiers": [
                        "left_shift"
                    ]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "international3",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "backslash"
                }
            ],
            "type": "basic"
        }
    ]
}
  • 左右花括号号映射 {}
{
    "description": "左右花括号号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "close_bracket",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "open_bracket",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "backslash",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "close_bracket",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 向上尖括号映射 ^
{
    "description": "向上尖括号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "equal_sign",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "6",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 波浪号映射 ~
{
    "description": "波浪号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "equal_sign",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "grave_accent_and_tilde",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 着重符 `
{
    "description": "着重符",
    "manipulators": [
        {
            "from": {
                "key_code": "open_bracket",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "grave_accent_and_tilde"
                }
            ],
            "type": "basic"
        }
    ]
}
  • @映射
{
    "description": "@映射",
    "manipulators": [
        {
            "from": {
                "key_code": "open_bracket",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "2",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 冒号映射 :
{
    "description": "冒号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "quote",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "semicolon",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 星号映射 *
{
    "description": "星号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "quote",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "8",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 方括号映射 [ ]
{
    "description": "方括号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "close_bracket",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "open_bracket"
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "backslash",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "close_bracket"
                }
            ],
            "type": "basic"
        }
    ]
}
  • 加减号映射 + _
{
    "description": "加减号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "semicolon",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "equal_sign",
                    "modifiers": [
                        "left_shift"
                    ]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "hyphen",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "hyphen"
                }
            ],
            "type": "basic"
        }
    ]
}
  • 双引号映射
{
    "description": "双引号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "2",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "quote",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 单引号映射
{
    "description": "单引号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "7",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "quote"
                }
            ],
            "type": "basic"
        }
    ]
}
  • &映射
{
    "description": "&映射",
    "manipulators": [
        {
            "from": {
                "key_code": "6",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "7",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 左右括号映射
{
    "description": "左右括号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "8",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "9",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "9",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "0",
                    "modifiers": [
                        "shift"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}
  • 等于号映射
{
    "description": "等于号映射",
    "manipulators": [
        {
            "from": {
                "key_code": "hyphen",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "equal_sign"
                }
            ],
            "type": "basic"
        }
    ]
}
  • 等号 减号 映射ろ映射
{
    "description": "等号 减号 映射ろ映射",
    "manipulators": [
        {
            "from": {
                "key_code": "international1",
                "modifiers": {
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "equal_sign"
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "international1",
                "modifiers": {
                    "mandatory": [
                        "shift"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "hyphen"
                }
            ],
            "type": "basic"
        }
    ]
}

  • 锁定屏幕
{
    "description": "锁定屏幕",
    "manipulators": [
        {
            "from": {
                "key_code": "l",
                "modifiers": {
                    "mandatory": [
                        "left_command"
                    ],
                    "optional": [
                        "caps_lock"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "q",
                    "modifiers": [
                        "control",
                        "left_command"
                    ]
                }
            ],
            "type": "basic"
        }
    ]
}

其他自己想自定义键位映射可以根据上述参考去修改!在这里插入图片描述
大功告成!!🎉🎉🎉
关掉软件即可

最终效果

  • = 号直接打出
  • { 可以直接打出
  • @可以直接打出
  • *可以直接打出
  • \ 需要shift + ¥
  • かな 对应 _
  • ろ键(右shift的左边) = 如果 shift + ろ 是-
  • 左侧shift(右侧shift也可以) 和右侧各种符号键 来回切换
  • 我喜欢用搜狗输入法右侧shift切换中英问
    在这里插入图片描述
  • 20
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值