Home

Previous Entry | Next Entry

bw

Dear Lazyweb,

My external keyboard has an "eject" button. When I prod it, if the CD in the drive is not in use it is unmounted and the drive ejected; if the CD is in use, nothing happens. This is pretty much the behaviour I expect and want.

My laptop's keyboard does not have an eject button, so when I'm somewhere other than home I have to unmount the disk manually. Is there a sensible way to make the eject button on the drive behave like the software eject key, rather than working iff the disk is not mounted?

This proposes "a fix", which is to not lock the tray while the disk is mounted. This sounds like a really bad idea — "Hey! Program doing useful stuff with that disk when I accidentally poked the eject button! You lose! Ha ha ha!" — particularly since sensible software methods exist.

I remember seeing a program somewhere on the 'tubes that polled the drive every second or so to see if the button had been pressed and if so called eject. Submount exists, but my brief investigation suggests that it polls, too. I'm uncomfortable with the idea of such frequent polling. Surely there must be some file in /proc or something that such a program could block on, waiting for an event?

Love,

Will

Tags:

Comments

[info]evath wrote:
Aug. 3rd, 2007 03:12 pm (UTC)
I very much assume no. However why about using something like win-F12 as a soft eject on the keyboard.
[info]resiak wrote:
Aug. 6th, 2007 02:02 pm (UTC)
We are mapping your soft eject keys
You're right on both counts. I did a bit more research, and it looks like there is actually no way in general to find the state of a CD drive without polling it. (That said, HAL already runs a daemon which polls it, so it probably sends some magic DBus event I could listen for.)

But I have mapped Win+Menu to `eject`, which does the job nicely. Thanks for the idea. :-)
[info]evath wrote:
Aug. 6th, 2007 05:32 pm (UTC)
Re: We are mapping your soft eject keys
No problem, glad you understood what I wrote. I'm getting worse and worse at constructing English.