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?

6 Answers6

48

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

dnozay
  • 23,846
  • 6
  • 82
  • 104
David Röthlisberger
  • 1,786
  • 15
  • 20
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.

j0k
  • 22,600
  • 28
  • 79
  • 90
Miroslav Kuťák
  • 1,875
  • 1
  • 18
  • 24
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.
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Carl Smith
  • 3,025
  • 24
  • 36
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

clemsam lang
  • 440
  • 3
  • 11
  • 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](https://superuser.com/a/1804009/) on SuperUser. – joeljpa Aug 17 '23 at 06:59
2

KeyRemap4MacBook

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

calql8edkos
  • 429
  • 4
  • 13
1

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

  • 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](https://forum.keyboardmaestro.com/t/how-to-make-any-key-a-new-modifier-key/6809) in KM to make F18 a new modifier key. – Carl Smith Apr 13 '17 at 22:00
  • 3
    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. – MJV Jul 13 '17 at 07:08