I have been trying to figure this out ever since I got an optibay and then ended up with a useless button on the keyboard. After hours of frustration and trying different things I have found the way to make the Eject button on the keyboard eject the external cd/dvd drive and not affect any hdd/ssd/flash drives or anything else connected via usb or sata.
Notice: I am not sure if this will work for Leopard or Tiger, only that the software used does work on those operating systems.
What you will need:
KeyRemap4Macbook - Works for Lion, Snow Leopard, Leopard, and Tiger.
Steps:
1. Download and install KeyRemap4Macbook. Restart is required for use.
2. Open System Preferences > KeyRepma4Macbook
3. Make sure you are on the "Change Key" menu and click in the search bar in KeyRemap4Macbook, not the search for System Preferences.
4. Type "eject" in the search bar and check the box next to "Eject to Command+Control+Option+Shift+E"
5. Exit System Preferences and open Automator.
6. Choose the template "Service" and hit "Choose" at the bottom right.
7. In the search bar at the top left, type "Run Shell Script"
8. Drag "Run Shell Script" from the left to the Workflow Area.
9. At the top above "Run Shell Script" click the arrows next to "Service receives selected text" and pick "no input" at the bottom of the list.
10. Next delete "cat" from the Shell Script and type this "drutil eject"
11. While in Automator go File > Save As > Eject
12. Close Automator and open System Preference > Keyboard > Keyboard Shortcuts
13. In Keyboard Shortcuts choose Services in the left box.
14. In the right, scroll down to "General" and you should see "Eject" listed.
15. Make sure the box beside "Eject" is marked and double click on the right side just to the left of the scroll bar.
16. This should bring up a textbox, in this box type "Command+Control+Option+Shift+E"
17. After you do that it should close the box and you will then see the key combination listed beside "Eject"
18. Close System Preferences and the Eject key should now eject your external cd/dvd drive.
Note 1: The eject key needs to be held down for a short time, similar to before. It will not work if you just press it like any other key.
Note 2: There is a slight delay for the service to run, I am not sure if adding "drutil list" before "drutil eject" would fix this or not.
Note 3: KeyRemap4Macbook takes a little bit to startup on my MBP, your experience may differ.
Note 4: "Eject to Command+Control+Option+Shift+E" must be selected in KeyRemap4Macbook before you apply the shortcut in Keyboard Shortcuts, if you disable it in KeyRemap4Macbook and renable it you may need to redo the shortcut also.
Thanks to subsonix for helping me with the Shell Script.
Notice: I am not sure if this will work for Leopard or Tiger, only that the software used does work on those operating systems.
What you will need:
KeyRemap4Macbook - Works for Lion, Snow Leopard, Leopard, and Tiger.
Steps:
1. Download and install KeyRemap4Macbook. Restart is required for use.
2. Open System Preferences > KeyRepma4Macbook
3. Make sure you are on the "Change Key" menu and click in the search bar in KeyRemap4Macbook, not the search for System Preferences.
4. Type "eject" in the search bar and check the box next to "Eject to Command+Control+Option+Shift+E"
5. Exit System Preferences and open Automator.
6. Choose the template "Service" and hit "Choose" at the bottom right.
7. In the search bar at the top left, type "Run Shell Script"
8. Drag "Run Shell Script" from the left to the Workflow Area.
9. At the top above "Run Shell Script" click the arrows next to "Service receives selected text" and pick "no input" at the bottom of the list.
10. Next delete "cat" from the Shell Script and type this "drutil eject"
11. While in Automator go File > Save As > Eject
12. Close Automator and open System Preference > Keyboard > Keyboard Shortcuts
13. In Keyboard Shortcuts choose Services in the left box.
14. In the right, scroll down to "General" and you should see "Eject" listed.
15. Make sure the box beside "Eject" is marked and double click on the right side just to the left of the scroll bar.
16. This should bring up a textbox, in this box type "Command+Control+Option+Shift+E"
17. After you do that it should close the box and you will then see the key combination listed beside "Eject"
18. Close System Preferences and the Eject key should now eject your external cd/dvd drive.
Note 1: The eject key needs to be held down for a short time, similar to before. It will not work if you just press it like any other key.
Note 2: There is a slight delay for the service to run, I am not sure if adding "drutil list" before "drutil eject" would fix this or not.
Note 3: KeyRemap4Macbook takes a little bit to startup on my MBP, your experience may differ.
Note 4: "Eject to Command+Control+Option+Shift+E" must be selected in KeyRemap4Macbook before you apply the shortcut in Keyboard Shortcuts, if you disable it in KeyRemap4Macbook and renable it you may need to redo the shortcut also.
Thanks to subsonix for helping me with the Shell Script.
Last edited: