博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
解决 macOS Sierra中F11映射成end之后无法调低音量的问题
阅读量:7017 次
发布时间:2019-06-28

本文共 10582 字,大约阅读时间需要 35 分钟。

hot3.png

macOS Sierra 中可以使用Karabiner-Elements 进行按键映射:

我的目的是单独按下F11,就相当于按下end.

但是fn+F11 ,就无法减少音量了,很奇怪.

所以采用脚本的方法实现:

{      "description": "Post end when F11 is pressed alone.post home when is held util 1 second",      "manipulators": [        {          "from": {            "key_code": "f11",            "modifiers": {            }          },          "to": [            {            }          ],          "to_if_held_down": [            {              "key_code": "home"            }          ],          "parameters": {            "basic.to_delayed_action_delay_milliseconds": 2500,            "basic.to_if_held_down_threshold_milliseconds": 1000          },          "to_if_alone": [            {              "key_code": "end"            }          ],          "type": "basic"        }      ]    }

上述脚本的功能:

1,单独按下F11,相当于end;

2,单独按下F11,不松开,触发home;

多长时间算作不松开,由to_if_held_down_threshold_milliseconds 指定;

3,不影响fn+F11,依然可以减少音量

详解:

 

参考:

 

附录:我的Karabiner-Elements 配置

本地配置文件:

/Users/whuanghkl/.config/karabiner/assets/complex_modifications

{  "title": "Change control key",  "rules": [        {      "description": "Post F17 if right_command is pressed alone.单独按下right_command触发F17",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "right_command",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "right_command"            }          ],          "to_if_alone": [            {              "key_code": "f17"            }          ]        }      ]    },    {      "description": "Post F16 if right_option is pressed alone.单独按下right_option/alt触发F16",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "right_option",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "right_option"            }          ],          "to_if_alone": [            {              "key_code": "f16"            }          ]        }      ]    },    {      "description": "Post F18 if fn is pressed alone.单独按下 fn 触发F18",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "fn",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "fn"            }          ],          "to_if_alone": [            {              "key_code": "f18"            }          ]        }      ]    },    {      "description": "Post COMMAND_L+` if left_command is pressed alone.单独按下left_command触发IDEA 回到句尾",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "left_command",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "left_command"            }          ],          "to_if_alone": [            {              "key_code": "grave_accent_and_tilde",              "modifiers": [                "left_command"              ]            }          ]        }      ]    },    {      "description": "Post TAB, ModifierFlag::COMMAND_L if left_control is pressed alone.单独按下left_control触发切换窗口",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "left_control",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "left_control"            }          ],          "to_if_alone": [            {              "key_code": "tab",              "modifiers": [                "left_command"              ]            }          ]        }      ]    },    {      "description": "Post T, ModifierFlag::COMMAND_L if left_option is pressed alone.单独按下 left_option 触发IDEA 接口路径查找",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "left_option",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "left_option"            }          ],          "to_if_alone": [            {              "key_code": "t",              "modifiers": [                "left_command"              ]            }          ]        }      ]    },    {      "description": "Post right_command when return_or_enter is hold.",      "manipulators": [        {          "from": {            "key_code": "return_or_enter",            "modifiers": {            }          },          "to": [            {              "key_code": "right_command"            }          ],          "to_if_alone": [            {              "key_code": "return_or_enter"            }          ],          "type": "basic"        }      ]    },    {      "description": "Post end when F11 is pressed alone.post home when is held util 1 second",      "manipulators": [        {          "from": {            "key_code": "f11",            "modifiers": {            }          },          "to": [            {            }          ],          "to_if_held_down": [            {              "key_code": "home"            }          ],          "parameters": {            "basic.to_delayed_action_delay_milliseconds": 2500,            "basic.to_if_held_down_threshold_milliseconds": 1000          },          "to_if_alone": [            {              "key_code": "end"            }          ],          "type": "basic"        }      ]    },    {      "description": "Post right_command when space is hold.按下 space 并且hold时触发 right_command",      "manipulators": [        {          "from": {            "key_code": "spacebar",            "modifiers": {            }          },          "to": [            {              "key_code": "right_command"            }          ],          "to_if_alone": [            {              "key_code": "spacebar"            }          ],          "type": "basic"        }      ]    },    {      "description": "Change caps_lock key to command+control+option+shift. (Post escape key when pressed alone)",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "caps_lock",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "left_shift",              "modifiers": [                "left_command",                "left_control",                "left_option"              ]            }          ],          "to_if_alone": [            {              "key_code": "escape"            }          ]        }      ]    },    {      "description": "Change shift_r key to B+COMMAND_L+CONTROL_L. (IDEA build)",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "right_shift",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "right_shift"            }          ],          "to_if_alone": [            {              "key_code": "b",              "modifiers": [                "left_command",                "left_control"              ]            }          ]        }      ]    },    {      "description": "Post COMMAND_L+OPTION_L+I if esc(F13) is pressed alone,打开浏览器调试",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "f13",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "f13"            }          ],          "to_if_alone": [            {              "key_code": "i",              "modifiers": [                "left_command",                "left_option"              ]            }          ]        }      ]    },    {      "description": "Post option_L+T(svn update) right_option x2(双击);post left_shift+10(IDEA run) when is pressed alone",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "right_option",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "t",              "modifiers": [                "left_option"              ]            }          ],          "conditions": [            {              "type": "variable_if",              "name": "right_option pressed",              "value": 1            }          ]        },        {          "type": "basic",          "from": {            "key_code": "right_option",            "modifiers": {              "optional": [                "any"              ]            }          },          "parameters": {            "basic.to_delayed_action_delay_milliseconds": 1000          },          "to": [            {              "set_variable": {                "name": "right_option pressed",                "value": 1              }            },            {              "key_code": "right_option"            }          ],          "to_delayed_action": {            "to_if_invoked": [              {                "set_variable": {                  "name": "right_option pressed",                  "value": 0                }              },              {                "key_code": "f10",                "modifiers": [                  "left_shift"                ]              }            ],            "to_if_canceled": [              {                "set_variable": {                  "name": "right_option pressed",                  "value": 0                }              }            ]          }        }      ]    },    {      "description": "Post return_or_enter if right_control is pressed alone.",      "manipulators": [        {          "type": "basic",          "from": {            "key_code": "right_control",            "modifiers": {              "optional": [                "any"              ]            }          },          "to": [            {              "key_code": "right_control"            }          ],          "to_if_alone": [            {              "key_code": "return_or_enter"            }          ]        }      ]    }  ]}

mac 快捷键

 

 

转载于:https://my.oschina.net/huangweiindex/blog/1801521

你可能感兴趣的文章
Android开机自动运行APP——BroadcastReceiver
查看>>
java.io几种读写文件的方式
查看>>
Spring中常用的注解(@Entity,@Table,@Column,@Repository,@Service)
查看>>
SharePoint 2013 配置传入电子邮件(一)
查看>>
Linux命令篇之chsh命令和chfn命令
查看>>
Useful websites
查看>>
转贴:下辈子,无论爱与不爱,都不会再见
查看>>
内核mailbox
查看>>
echarts - 树图实现四个层级
查看>>
【Kotlin】spring boot项目中,在Idea下启动,报错@Configuration class 'BugsnagClient' may not be final....
查看>>
Leetcode | Merge k Sorted Lists
查看>>
深入理解JavaScript(1)
查看>>
foreach遍历----for(object o: list)
查看>>
iOS被开发者遗忘在角落的NSException-其实它很强大
查看>>
java.lang.IllegalArgumentException: Can not set int field *** to null value
查看>>
NSString类的相关用法
查看>>
Python编写简单计算器(正则表达式应用)
查看>>
KMP - HDU 1711 Number Sequence
查看>>
Storm 第四章 Storm常见问题
查看>>
「每日一码」(精品代码,质量保证)阶乘
查看>>