I bought a Logitech USB keyboard (model K120) to use with my MBP while it's on a stand.

I got some help swapping the mapping of the command and option keys to the Alt and Windows keys so the layout is more like a standard Mac keyboard.

The next problem is this key: enter image description here

(The one under the shift key with the rectangle with 3 lines on it.)

Apparently this is a Windows Context menu key.

I'm an iOS/Mac OS developer, and I keep pressing that key by mistake. It puts some non-displayed character into my source files. It generates an error "invalid character in source file" that prevents my code from compiling. Since it's non-printing it is quite hard to find, and is a real pain.

I'd like to map it to NOTHING so it stops inserting invisible compile-breaking characters into my source files. Alternately, mapping it to the control key would be good, since the control key is in the same spot on the other side of the keyboard. (I'd then have 2 control keys on that side of the keyboard, but whatever.)

  • 1
    The button is for a context menu. So instead of Right Clicking on something, you can simply press that key. Super handy if you are a heavy keyboard user and not reliant on using the mouse for everything. – dave k Dec 8 '16 at 19:54
  • Ok but it doesn't have any meaning in Mac OS, correct? It is inserting some sort of non-printable character into my source, and causing compiler errors that are driving me nuts. From Mac OS it does nothing but harm and I want to murder it with extreme prejudice. – Duncan C Dec 8 '16 at 21:30
  • I guess Mac just doesn't understand it's usefulness. Best of luck to you. – dave k Dec 8 '16 at 23:28

Provided you are not running macOS Sierra (which from a previous question, I know you are). Support for Sierra is promised to come.

Install Karabiner.

Run it and on Change Key tab search for "Application Key" (or navigate to "For PC Users" -> "Change PC Application Key (Menu Key)".

Select the mapping "Application Key to Control_L".


To disable completely you'd have to edit ~Library/Application Support/Karabiner/private.xml (examples). The key code (reference) is PC_APPLICATION, so the following line will add a menu entry:

<?xml version="1.0"?>
<root>
  <item>
    <name>Disable Windows context key</name>
    <identifier>private.disable_windows_context_key</identifier>
    <autogen>__KeyToKey__ KeyCode::PC_APPLICATION | ModifierFlag::NONE</autogen>
  </item>
</root>

(press "Reload XML" in Karabiner window to apply after editing the file)

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.