I'm porting an application from Carbon to Cocoa.  There are a few things in it 
that I'm having problems finding the cocoa equivalent.

The app is a music education product for kids.  They have to tap the rhythm on 
the spacebar or the mouse button in parts of the program -- i.e. precise timing 
is very important.  In the carbon version, I use GetMouse(), GetButton(), 
GetKeys(), etc. inside an interrupt (PrimeTime()).  

I can use NSView functions mouseDown, keyDown, etc. but the timing is not 
always sufficiently precise.  This is especially true when the entire window is 
updated and 

I would like to create a thread (NSThread) with a bumped-up priority and poll 
the mouse and keyboard the same way I did in the carbon version.  I'd like to 
use the cocoa equivalents of GetButton() and GetKeys() but I can't find them.  

What puzzles me is that GetKeys() still exists in 10.6.  It is not deprecated.  
It runs fine in 64bit mode.  Also, GetMouse() and GetButton() have updated 
equivalents as HiGetMousePosition() and GetCurrentEventButtonState().  These 
functions are part of the 'High Level Toolkit'.  

The Carbon64BitGuide.pdf explains how the carbon api's have been updated for 64 
bit.  But I thought carbon was dead in 64 bit and Snow Leopard.  What is the 
deal?  Am I safe using these api's. Are we supposed to not use them?  Will they 
go away in 10.7?  Why do I read everywhere that carbon is dead and high level 
toolkit is dead?  

If High Level Toolkit is ok, then why doesn't it appear in the docs.   If I 
search the Mac OS X Reference Library, it does not get the same treatment that 
the cocoa api gets. The only place I see the High Level Toolkit is in the 
Carbon64BitGuide.pdf and the header files and some cruddy api update doc. 

Is there a way to poll the state of the hardware using cocoa api's instead of 
the carbon api's?   

(Please don't tell me how cocoa is great and carbon is for losers.  I'm on 
board with the cocoa thing.)

Thanks,
Joel



_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to