Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My keyboard switch for ejecting the CDROM does not work though it displays an eject button on the screen. I need to make it work. I know ejecting a cdrom using system call is as simple as


But I don't know how to connect the an executable that contains the above system call and the event of pressing the eject key? Or shall I rely on kernel level? If then how?

share|improve this question
It might try to call eject -- have you installed that? (Does eject /dev/cdrom in a terminal work?) – sr_ Jan 15 '13 at 8:35
I don't have any problem with ejecting the cdrom using eject command. However eject key on my keyboard does not work. – PaulDaviesC Jan 15 '13 at 10:31
I was just trying to find out what could be the reason for your eject key causing the eject button display on screen while failing to actually eject the cdrom... What's your desktop environment? The cdrom isn't mounted, right? – sr_ Jan 15 '13 at 11:18
So GNOME? I'm not a user but a lot of DEs and window managers allow you to create custom shortcuts. If there is a GUI interface to set them in, it will probably pick up the correct keycode for you, then you just link that to the eject command. – goldilocks Jan 15 '13 at 11:47
Yeah! It did work. I was wondering how the things where working internally :) – PaulDaviesC Jan 15 '13 at 11:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.