Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

ioctl(cdromfd,CDROMEJECT,0)

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
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

 
discard

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

Browse other questions tagged or ask your own question.