• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Eject Key Code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Eject Key Code


  • Subject: Re: Eject Key Code
  • From: Pascal Pochet <email@hidden>
  • Date: Tue, 27 Jun 2006 15:00:32 +0200

Le 26-juin-06 à 21:20, Damien Bobillot a écrit :


Casey Fleser wrote :

Check this post:

http://www.cocoabuilder.com/archive/message/cocoa/2004/10/5/118853

The relevant bits of which are:

[really interesting code]

And the tiebreaker question is ;) :
Is there a more direct way to open the CD tray, by using the IOKit by instance ? It's a bit tricky to simulate a keystroke just to open the CD tray. If I recall well, the command line tool hdiutil may be used to open it.


--
Damien Bobillot


Solution is in DiscRecording framework

#import <DiscRecording/DRDevice.h>
...
NSArray *devices = [DRDevice devices]   ;
NSEnumerator *aEnum = [devices objectEnumerator];
DRDevice *aDevice       ;

while ((aDevice = [aEnum nextObject]) != nil) {
if ([[[aDevice info] objectForKey:DRDeviceLoadingMechanismCanOpenKey] boolValue]) {
// there are also DRDeviceLoadingMechanismCanInjectKey and DRDeviceLoadingMechanismCanEjectKey
// the device supports openTray and closeTray
[aDevice openTray] ;


                        ...


[aDevice closeTray] ; } }




Pascal Pochet email@hidden


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Eject Key Code (From: Daniel Tse <email@hidden>)
 >Re: Eject Key Code (From: Damien Bobillot <email@hidden>)
 >Re: Eject Key Code (From: Casey Fleser <email@hidden>)
 >Re: Eject Key Code (From: Damien Bobillot <email@hidden>)

  • Prev by Date: Multiple Definitions of symbol _tgammaf (and 30 other symbols)
  • Next by Date: Re: NSStrings and data bytes
  • Previous by thread: Re: Eject Key Code
  • Next by thread: Re: Eject Key Code
  • Index(es):
    • Date
    • Thread