I suppose you could study the source code for *eject* to see how eject determines the status of the drive tray, then either opens or closes the tray.
Then trap the button press (I assume that's an application button and not the button on the drive itself), then test it against the status of the drive tray: if open, close tray, else inform the user that the tray is already closed.
|