How to remap "Context Menu" key in Mac OS X? [closed]
Asked Answered
B

6

41

I have a Logitech keyboard (Ultra-Flat Keyboard Dark Shine to be exact), which has the context menu key in the middle of the windows and alt key, which is quite annoying.

Here's a screenshot of where the key is:

http://freshlog.com/grabs/ff532-How_do_I_remap_the_context_menu_key_in_Mac_OS_X

I can remap the windows and alt keys under the default Keyboard System Preferences Panel, but there doesn't seem to be a way to remap the context menu key.

Any ideas?

Bumboat answered 16/6, 2009 at 5:11 Comment(0)
L
49

Use KeyRemap4MacBook (Karabiner for osx 10.9, 10.10). As Mecki pointed out, XML .keylayouts / Ukelele can't solve your problem.

In spite of the name, KeyRemap4MacBook works on any Mac (OS X 10.4 or later).

The settings you want are under "For PC Users" » "Change PC Application Key".

enter image description here

Lizarraga answered 7/2, 2011 at 15:52 Comment(5)
Using @David's suggestion, map it to Option_LCannonball
Why would you want to map it to command-L? To quickly go to the location bar in your browser?Nystagmus
@Nystagmus when Karabiner says "Command_L" it means the Left Command key.Historicity
Does Karabiner need to be left running for this to work?Banneret
@SamanthaCatania - Sort of. You can close the Karabiner GUI completely when you're not actively configuring Karabiner. Karabiner itself is a kernel extension, so it's always running in the background.Aperient
A
8

Use KeyRemap4Macbook. Edit private.xml file like this:

<item>
    <name>Change Windows context menu key to Right option key</name>
    <identifier>private.win_context_menu_option_key</identifier>
    <autogen>--KeyToKey-- KeyCode::PC_APPLICATION, KeyCode::OPTION_R</autogen>
</item>

This code will remap right option key to the context menu key.

Aultman answered 11/12, 2012 at 10:34 Comment(0)
A
4

You can use Karabiner to map App to Command+Option:

You can then use Keyboard Maestro to map Command+Option+Letter, where Letter is a key that denotes an application, to focus the application:

For example, you can then do App+C to focus Chrome, App+T to focus Terminal, App+S to focus Slack etc. (if an app isn't already open, Keyboard Maestro opens it first).

If you're using a generic keyboard, then you have a dedicated App key:

If you're using an Apple keyboard, you have to hold Command and Option, but they are next to each other, and appear on both sides of the spacebar:

Keep in mind that OS X already uses Command+Option+Esc to open the Force Quit Applications dialogue, so you could now use App+Esc for that. Likewise, OS X uses Command+Option+W to close all of the windows in the focus application (tabs in Chrome).

Notes:

  • Karabiner is an open source kernel extension for modifying the way keyboard input is handled by OS X.
  • Keyboard Maestro is a proprietary application for creating keyboard shortcuts in OS X. It has a free 30 day trial, and costs $36.
Aperient answered 27/2, 2016 at 13:55 Comment(1)
Keyboard Maestro changed my life! Automate EVERYTHING!Congest
C
4

The latest MacOS versions are served by Karabiner Elements 12.1.
Key-to-key remapping are done in the Simple Modifications tab and conveniently selected in 2 rows of drop-down-menus (see: screenshot).

Complex Modifications in this Preferences Panel's tab have either to be added by importing them from the internet (Karabiner-E.'s site) or from the user's ~/.config/karabiner/assets/ complex_modifications folder.
"Complex" ones from the net actually are also copied there and switched "on" (= [+ Enable]) in the tab.

ALL modifications are finally stored (& thus "activated") in ~/.config/karabiner/karabiner.json.

A pragmatic procedure (that also helps avoid mistakes while writing complex-mods yourself) is to copy & rename & alter one "imported" mod.
Once you are experienced (e.g.: different bracket types) it may be easier to edit the json file directly…


(Inline graphic shows part of drop-down-menu)

There is no longer the option to constrict remaps to specific windows (can be simulated by an osascript AppleScript) as some other features.
A non-Element version of Karabiner is being developed.

Two sites to get information & questions (answered) – but please search for previous "doubles" !:

github.com >> Karabiner-Elements
groups.google.com/forums/ osx-karabiner

Cecilius answered 7/12, 2018 at 8:42 Comment(1)
Since this answer helped me but is closed here, here's the link to my shorter, updated version of it answering Switch the keys caps lock and shift on SuperUser.Kimberleekimberley
C
2

KeyRemap4MacBook

Entry: For PC Users -> Change PC Application Key -> Application Key to Option_L

Corso answered 17/5, 2013 at 9:37 Comment(0)
P
1

Unfortunately the latest macOS Sierra doesn't support Karabiner yet. An easy solution is to convert capslock key with command key.

Piton answered 5/4, 2017 at 16:1 Comment(2)
I currently use Keyboard Maestro to work around the limitations of Karabiner Elements. I use KM to map my App key to F18, and then use this macro in KM to make F18 a new modifier key.Aperient
Karabiner Elements works in Sierra. The application (or context menu) key can be found as "application" and can be mapped to e.g. "right_option" which in my case made my Microsoft Ergo keyboard match the layout of my MacBook laptop.Rosecan

© 2022 - 2025 — McMap. All rights reserved.