macos下用karabiner实现preview翻半页
其实我没找到翻半页的方式,只是搞了个方法多翻几行,来达到效果。
配置文件目录:
/Users/xxx/.config/karabiner/assets/complex_modifications
新增一个my.json
{
"title": "my_key_map",
"rules": [
{
"description": "my_key_map",
"manipulators": [
{
"type": "basic",
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Preview$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "d"
},
"to": [
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
},
{
"key_code": "up_arrow"
}
]
},
{
"type": "basic",
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Preview$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "f"
},
"to": [
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
},
{
"key_code": "down_arrow"
}
]
},
{
"type": "basic",
"from": {
"key_code": "u",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"command"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "y",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"command",
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "i",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"command"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "o",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"command",
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "comma",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "period",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"shift"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "d",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_or_backspace"
}
]
}
]
}
]
}
然后在karabiner的设置中重新加载一下rule,remove再enable。
本文来自博客园,作者:ssh_alitheia,转载请注明原文链接:https://www.cnblogs.com/shanchuan/p/15315165.html