Mac键盘修改F1-F12为功能键,神器karabiner-elements

弄了个宁芝键盘,这个键盘的Mac模式右下角command对不上就算了,还得没有功能键,不过用起来确实舒服

京造的K8不得不说,学习成本低太多,基本就是一个Mac键盘。

img

于是在网上看到这个软件,也是折腾了好久才搞定, 给大家分享一下

下面会提供json文件,直接复制过去,就能实现我的功能,然后还可以自己对应修改想要的

 

主要是通过karabiner-elements软件,实现按键映射。

实现操作:

img

这里F5和F12我保留了,因为也没有那么多功能键要添加,就留了两个可能会用到的F键。

F1----F12所有键均改为----->左侧shift+F1---F12

image-20220729120729002

修改的时候可以打开一个在线的键盘测试网页,这样就知道自己的修改有没有生效

img

 

1、安装软件:

这个网上一大堆,下载汉化版或者英文原版都可以。下载安装后会生成两个程序,EvenViewer这个用不到,不用管,直接打开Elements

img

2、打开软件

image-20220729120938641

这个直接到选择设备,把要修改的键盘选上,我这里还有K8,所以要进行区分,这样就不会影响K8原本的配置了

3、修改配置文件

  • 选好后转到配置文件

    • 直接把配置文件名字改了

    • 这里就改成karabiner.json

    • image-20220729121150999

  • 打开其他

    • 打开配置文件位置

    • image-20220729121309637

    • 打开后如图

    • image-20220729121340636

    • 会有好多文件,其他的不用管,直接打开karabiner.json,如果没有就直接创建一个。

    • 打开后复制我写好的代码进去,保存关闭,即可生效;

  • image-20220729121511565

```json
{
     "global": {
         "check_for_updates_on_startup": true,
         "show_in_menu_bar": true,
         "show_profile_name_in_menu_bar": false
     },
     "profiles": [
         {
             "complex_modifications": {
                 "parameters": {
                     "basic.simultaneous_threshold_milliseconds": 50,
                     "basic.to_delayed_action_delay_milliseconds": 500,
                     "basic.to_if_alone_timeout_milliseconds": 1000,
                     "basic.to_if_held_down_threshold_milliseconds": 500,
                     "mouse_motion_to_scroll.speed": 100
                 },
                 "rules": [
                     {
                         "description": "Mapping [left_o0,F11,F12}",
                         "manipulators": [
                             {
                                 "from": {
                                     "key_code": "f1",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f1"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f2",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f2"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f3",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f3"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f4",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f4"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f5",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f5"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f6",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f6"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f7",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f7"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f8",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f8"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f9",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f9"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f10",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f10"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f11",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f11"
                                     }
                                 ],
                                 "type": "basic"
                             },
                             {
                                 "from": {
                                     "key_code": "f12",
                                     "modifiers": {
                                         "mandatory": [
                                             "left_shift"
                                         ],
                                         "optional": [
                                             "any"
                                         ]
                                     }
                                 },
                                 "to": [
                                     {
                                         "key_code": "f12"
                                     }
                                 ],
                                 "type": "basic"
                             }
                         ]
                     }
                 ]
             },
             "devices": [
                 {
                     "disable_built_in_keyboard_if_exists": false,
                     "fn_function_keys": [],
                     "identifiers": {
                         "is_keyboard": true,
                         "is_pointing_device": true,
                         "product_id": 272,
                         "vendor_id": 1452
                     },
                     "ignore": false,
                     "manipulate_caps_lock_led": true,
                     "simple_modifications": []
                 },
                 {
                     "disable_built_in_keyboard_if_exists": false,
                     "fn_function_keys": [],
                     "identifiers": {
                         "is_keyboard": true,
                         "is_pointing_device": false,
                         "product_id": 834,
                         "vendor_id": 1452
                     },
                     "ignore": true,
                     "manipulate_caps_lock_led": true,
                     "simple_modifications": []
                 },
                 {
                     "disable_built_in_keyboard_if_exists": false,
                     "fn_function_keys": [],
                     "identifiers": {
                         "is_keyboard": true,
                         "is_pointing_device": false,
                         "product_id": 45890, 
                        "vendor_id": 1133 
                    }, 
                    "ignore": true, 
                    "manipulate_caps_lock_led": false, 
                    "simple_modifications": [] 
                } 
            ], 
            "fn_function_keys": [ 
                { 
                    "from": { 
                        "key_code": "f1" 
                    }, 
                    "to": { 
                        "apple_vendor_keyboard_key_code": "mission_control" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f2" 
                    }, 
                    "to": { 
                        "apple_vendor_keyboard_key_code": "launchpad" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f3" 
                    }, 
                    "to": { 
                        "consumer_key_code": "display_brightness_decrement" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f4" 
                    }, 
                    "to": { 
                        "consumer_key_code": "display_brightness_increment" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f5" 
                    }, 
                    "to": { 
                        "key_code": "f5" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f6" 
                    }, 
                    "to": { 
                        "consumer_key_code": "rewind" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f7" 
                    }, 
                    "to": { 
                        "consumer_key_code": "fast_forward" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f8" 
                    }, 
                    "to": { 
                        "consumer_key_code": "play_or_pause" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f9" 
                    }, 
                    "to": { 
                        "consumer_key_code": "mute" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f10" 
                    }, 
                    "to": { 
                        "consumer_key_code": "volume_decrement" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f11" 
                    }, 
                    "to": { 
                        "consumer_key_code": "volume_increment" 
                    } 
                }, 
                { 
                    "from": { 
                        "key_code": "f12" 
                    }, 
                    "to": { 
                        "key_code": "f12" 
                    } 
                } 
            ], 
            "name": "karabiner.json", 
            "parameters": { 
                "delay_milliseconds_before_open_device": 1000 
            }, 
            "selected": true, 
            "simple_modifications": [], 
            "virtual_hid_keyboard": { 
                "country_code": 0, 
                "mouse_key_xy_scale": 100 
            } 
        } 
    ], 
    "title": "Mapping [left_shift+{F1-F10,F11,F12} to {F1-F10,F11,F12}" 
}

```

至此配置就全部结束了,可以实现功能键操作

4、功能键贴纸

然后我在网上买了个功能键贴纸,但是还没到货,就先给大家放个图,等到了贴上去再发实图

 

IMG_7159

 

perfect!哈哈哈哈哈哈哈

 

 

 

 

posted on 2022-07-29 12:31  Tianhao丶  阅读(39)  评论(0编辑  收藏  举报

导航