4

Laptop has a button on the keyboard to eject CD-ROM like on Mac. It works fine on 12.04, but no longer on newer versions. Laptops has sold with the Windows.

The distribution of Ubuntu 12.04 has been taken from the official site ubuntu.com. Is it possible to fix the button in the new version of Ubuntu? The command 'eject' working in the terminal on all versions.

Vishnu N K
  • 595
  • 5
  • 22
  • Can anyone help to me? – Igor Kudryashov Aug 05 '15 at 09:20
  • Does this command temporarily fix matters: echo 0 > /proc/sys/dev/cdrom/lock ? Or with Google Translate: Имеет ли эта команда временно исправить вопросы: echo 0 > /proc/sys/dev/cdrom/lock ? – andrew.46 Mar 28 '16 at 09:05
  • The file 'lock' with value '0' already exist. It's not work. – Igor Kudryashov Mar 28 '16 at 20:25
  • @IgorKudryashov Does your button eject the tray when there's no disk in it? Or it refuses to eject only when the disk is loaded? Did you try to tap this button several times? Maybe it works when it is pressed together with Fn key? – whtyger Mar 29 '16 at 07:40
  • Pressing any function key "Volume", "brightness" & etc. accompanied by an icon on the screen. The laptop does not have a tray for the CD-ROM, there is only a gap (see pic http://www.pcworld.com/product/1148860/dell-xps-14z-notebook.html), but when you press the "eject" button appears on the screen icon and hear the sound of the engine. It works with the inserted disc and without disc too. It works in Ubuntu 12.04, but in Ubuntu 14.04 and 15.10 the button "eject" does not work. Fn does not help. – Igor Kudryashov Mar 30 '16 at 07:31
  • Extension: All other buttons work as before. In Ubuntu 14.04 and 15.10 the disc can be removed with "eject" command or by using the menu in Nautilus. – Igor Kudryashov Mar 30 '16 at 07:31
  • It is an old bug. This button is a hardware button (this can be checked by xev - it produces no output) so it cannot be reprogrammed as easily as a software one. It is a job for the kernel guys. Old WMI hotkeys driver project worked only with older 14.04 kernels and its compilation fails with new kernels. So the easiest workaround is to bind eject command to some free shortcut, as explained here for example. – whtyger Mar 31 '16 at 09:05
  • does the command line program eject eject the tray? – j0h Apr 03 '16 at 12:37
  • Yes, see above I wrote that in Ubuntu 14.04 and 15.10 the disc can be removed with "eject" command or by using the menu in Nautilus. Eject works if you assign any key combination except for the 'eject' button. In 12.04 the key 'eject' just works without any additional settings. – Igor Kudryashov Apr 04 '16 at 06:26

2 Answers2

1

just create a custom keyboard shortcut

Go to System Settings -> Keyboard -> Shortcuts and add a custom keyboard shortcut running the command 'eject'. Then assign that shortcut to the key on your laptop.

If somehow you have multiple ejectable drives, you'll have to specify in the command like 'eject /dev/cdromX'. If you've only one drive, just 'eject' should work.

Mark Kirby
  • 18,529
  • 19
  • 78
  • 114
kaushik
  • 41
  • Command 'eject' is already exist in keyboard settings. When I set an any free key combinations for 'eject' command, it works and CD-ROM is removed from laptop. But when i press the "eject" button on keyboard, the key's combination set as 'eject', ie this button is identified, but not working. This not problem in 12.04. Sorry for my bad English, I am use Google Translate. – Igor Kudryashov Aug 04 '15 at 08:40
  • Can anyone help to me? – Igor Kudryashov Aug 05 '15 at 09:20
0

The this problem has disappeared samself after the upgrade to Ubuntu 16.04 and in Ubuntu 18.04 the "Eject" button also works correctly.