有没有办法修改 OSX,使其表现得更像 Windows 7。具体来说,我真的希望能够按 BACKSPACE 并让 Finder 显示前一个文件夹......就像 Windows 和 Firefox 一样。
我希望这很清楚。
您可以按 CMD-[(如“Go”菜单中所示)。使用常规方式(键盘首选项 -> 键盘快捷键并为“后退”条目分配新的快捷键)不起作用,因为“键盘快捷键”字段不接受退格字符。但是你可以:

然后编辑文件$HOME/Library/Preferences/com.apple.finder.plist并将键盘快捷键更改为“?” 例如使用 XCode:

现在,如果您重新启动 Finder(使用killall Finder或强制退出应用程序对话框),您将能够使用快捷方式:

但是,正如评论中所指出的,退格键可能由于某种原因无法在键盘对话框中使用,因为将其用作快捷方式会在您将光标置于编辑框中时触发操作,您需要退格删除字符。
虽然barbaz提供的解决方案是一个不错的解决方案,但实际上有一个完美的解决方案:),它消除了不允许您在 Finder 的文本字段中使用退格键的限制(例如,在重命名文件或在搜索字段中键入时) )。
插入以下代码并保存 private.xml 文件:
<item>
<name>Backspace in Finder moves Up</name>?
<appendix> (except when editing text fields)</appendix>
<identifier>private.Backspace_MoveUp</identifier>
<only>FINDER</only>
<uielementrole_not>AXTextArea, AXTextField</uielementrole_not>
<autogen>__KeyToKey__ KeyCode::DELETE, ModifierFlag::NONE, KeyCode::CURSOR_UP, VK_COMMAND</autogen>
</item>
这将执行以下操作:
CURSOR_UP, VK_COMMAND上面的代码小智 5
尽管投票最多的答案“uielementrole_not”在当时是完美的,但它在最新版本的 Karabiner 中不起作用,因为 uielementrole_not 不是可用的选项。
无法添加特定条件会产生非常严重的副作用,就像原始发帖者所说的那样。
好吧,我找到了一种在新版本中使用 Karabiner 变量来避免这种情况的方法。这个想法是检测您何时处于编辑模式。它远非完美(请参阅底部的注释),但总比没有好得多。
这是击键列表及其工作方式:
这就是我所做的:
这些是执行该操作的所有规则:
{
"description": "Use F2 as Rename and enter edit mode",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com.apple.finder"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "f2"
},
"to": [
{"key_code": "return_or_enter"},
{"set_variable":
{
"name": "onedit",
"value": 1
}
}
],
"type": "basic"
}
]
}
,
{
"description": "Use Backspace as Go to Previous Folder in Finder if not editing",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com.apple.finder"
],
"type": "frontmost_application_if"
}
,
{
"type": "variable_unless",
"name": "onedit",
"value": 1
}
],
"from": {
"key_code": "delete_or_backspace"
},
"to": [
{
"key_code": "open_bracket",
"modifiers": [
"left_command",
"left_option"
]
}
],
"type": "basic"
}
]
},
{
"description": "Use Return as Open if not renaming file",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com.apple.finder"
],
"type": "frontmost_application_if"
}
,
{
"type": "variable_unless",
"name": "onedit",
"value": 1
}
],
"from": {
"key_code": "return_or_enter",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "o",
"modifiers": [
"right_command"
]
}
],
"type": "basic"
}
]
},
{
"description": "Use Return to finish renaming when onedit=1",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com.apple.finder"
],
"type": "frontmost_application_if"
},
{
"name": "onedit",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "return_or_enter",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{"key_code": "return_or_enter"},
{"set_variable":
{
"name": "onedit",
"value": 0
}
}
],
"type": "basic"
}
]
},
{
"description": "Use Esc to finish renaming when onedit=1",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com.apple.finder"
],
"type": "frontmost_application_if"
},
{
"name": "onedit",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "escape",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{"key_code": "escape"},
{"set_variable":
{
"name": "onedit",
"value": 0
}
}
],
"type": "basic"
}
]
}
Run Code Online (Sandbox Code Playgroud)
笔记:
| 归档时间: |
|
| 查看次数: |
15064 次 |
| 最近记录: |