Useless Eject key on Apple Wireless Keyboard
I have an Apple Wireless Keyboard that has an eject key on the top right. It is useless because my Retina MacBook Pro does not have a CD-ROM.
My MacBook is running OS X Mavericks and I expected eject key to do some power operations, just like the power key on the top-right of MacBook keyboard.
This key is useless now. How can I get it mapped?
Solution 1:
The wireless keyboard can be used with systems that do still have an optical drive, and if you had an external USB SuperDrive for your MacBook Pro, it would function for that.
Your power operations have always been on the eject key using modifier keys; only recently was the power key introduced as part of the keyboard itself.
- controleject will give you a dialog box where you can choose to go to sleep, restart or shut down.
- commandoptioneject will go straight to sleep.
- controlcommandeject will restart.
- controloptioncommandeject will shut down.
- controlshifteject will sleep your display only.
Solution 2:
You can use Karabiner (formerly KeyRemap4MacBook) to remap the eject key. Short presses of eject won't get registered unless you also install NoEjectDelay though.
This private.xml maps the eject key to a power button or key:
<?xml version="1.0"?>
<root>
<item>
<name>test</name>
<identifier>test</identifier>
<autogen>__ConsumerToKey__ ConsumerKeyCode::EJECT, KeyCode::VK_IOHIDPOSTEVENT_NX_POWER_KEY</autogen>
</item>
</root>
This makes pressing eject open Finder:
<?xml version="1.0"?>
<root>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_FINDER</name>
<url>file:///System/Library/CoreServices/Finder.app</url>
</vkopenurldef>
<item>
<name>Eject to Open Finder</name>
<identifier>Eject to Open Finder</identifier>
<autogen>__ConsumerToKey__ ConsumerKeyCode::EJECT, KeyCode::VK_OPEN_URL_FINDER</autogen>
</item>
</root>