Reputation: 6368
Is there an easy way to remap one keystroke to another in OSX El Capitan?
I want to assign F13 to ⇧⌥⌘4. (I use a little app called Imgup and that's the keystroke to upload a screenshot.)
This answer suggests using Keyboard Maestro. But I'm already running Karabiner and USB Overdrive so I'm hesitant to install more software.
I'm looking through the options in Karabiner and I don't see how to simply remap one key press to another, and obviously "upload screenshot to Imgur" isn't one of the choices since it's not a system command. Also I can't use "App Shortcuts" since in Imgup there's no menu item for this action.
Is there a simple format for writing an XML snippet in Karabiner that would allow this? Something like this?
<item>
<name>F13 to ⇧⌥⌘4</name>
<key><f13>
<definition>4 with Command AND Option and Shift down</definition>
</item>
Upvotes: 1
Views: 1011
Reputation: 1093
Karabiner-Elements 11.6.0 maps F13 to ⇧⌥⌘4 in MacOSX 10.11 El Capitan and later with
{"title": "Imgup F13 to ⇧⌥⌘4",
"rules": [
{"description": "Imgup F13 to ⇧⌥⌘4.",
"manipulators": [
{"type": "basic",
"from": {"key_code": "f13"},
"to": [{"key_code": "4", "modifiers": ["shift", "option", "command"]}]}]}]}
in a file like ~/.config/karabiner/assets/complex_modifications/imgup.json enabled by Karabiner-Elements > Window > Karabiner-Elements Preferences > Complex Modifications > Rules > Add Rule
Upvotes: 0
Reputation: 33691
Sorry I'm late to the party, but here's how to do it:
Delete everything already in the AppleScript box, then copy and paste this in:
on run {input, parameters}
tell application "System Events"
key code 21 using {command down, option down, shift down}
end tell
return input
end run
Run the Service using the Play button in the top right of the window to make sure it does what you want.
Save the Service using whatever title you'd like. This will make it available system-wide.
Now it's shortcut time.
Open System Preferences > Keyboard > Shortcuts, and select Services in the left pane
Upvotes: 1