Is there an way of modding OSX so that it behaves a little more like Windows 7. Specifically I really want to be able to press BACKSPACE and for Finder to show the previous folder... just like Windows and Firefox both do.
I hope that's clear.
While the solution offered by barbaz is a decent one, there actually is a perfect one :), which removes the limitation that doesn't allow you to use Backspace in text fields in Finder (e.g. when renaming files, or typing in the search field).
Insert the following code and save private.xml file:
<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>
This does the following:
CURSOR_UP, VK_COMMAND
code aboveYou can press CMD-[ (as shown in the "Go" menu). Using the regular way from there (Keyboard Preferences -> Keyboard Shortcuts and assign a new shortcut for the "Back" entry) doesn't work since the "Keyboard Shortcut" field does not accept the backspace character. But you can:
Then edit the file $HOME/Library/Preferences/com.apple.finder.plist
and change the keyboard shortcut to "⌫" for example using XCode:
Now, if you restart Finder (using killall Finder
or the Force Quit Applications dialog) you will be able to use the shortcut:
However, as pointed out in the comments, the backspace key is probably not usable in the keyboard dialog for a reason, since using it as a shortcut will trigger the action when you have the cursor in an edit box, where you'd want backspace to remove characters.
defaults write com.apple.finder NSUserKeyEquivalents -dict-add "Back" "\U232B"; killall Finder
. This isn't a practical solution though, it overrides the function of ⌫ (deleteBackward:
) in text fields.
Althouhg the most voted answer, with the "uielementrole_not", was perfect back in the day, it doesn't work in the lastest versions of Karabiner, as uielementrole_not is not an option available.
Being unable to add that specific condition had very bad side effects like the one the original poster says and others.
Well, I have found a way to avoid that in newer versions, using Karabiner variables. The idea is detecting when you are in edit mode. It's far from being perfect (see notes at the bottom) but it's far better than nothing.
This is the list of keystrokes and how they should work:
This is what I do:
These are all the rules to perform that:
{
"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"
}
]
}
Notes:
open "karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/honsa/f8396f9f0d33609ebac1a48a43ef835f/raw/26f5f2071e7dd133f3bfa47490711214ada12ceb/finder-navigation-karabiner.json"
Commented
Dec 1, 2021 at 21:23