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?

  • 1
    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
  • 1
    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
  • 1
    Yeah! It did work. I was wondering how the things where working internally :) – PaulDaviesC Jan 15 '13 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.