Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cursor position



The current on screen mouse location will be made available via Apple java api in the next seed, so you will not need native API for this.

FYI:The hotspot of a cursor is the location within the cursor which is the actual point on screen the cursor refers to. The appropriate way to get the location of the mouse on screen via Cocoa is to call the static selector 'mouseLocation' on the Cocoa class NSEvent.

Steve

On Wednesday, November 27, 2002, at 01:01 AM, Eric Albert wrote:

At 11:21 AM -0700 11/25/2002, Doug Zwick wrote:
GetGlobalMouse may or may not work with Java 1.4.1 due to Java 1.4.1
switching over from Carbon to Cocoa. If not you'll need to write a
"C callable wrapper function" for the JNI native method to call, which
in turn will make the appropriate Cocoa call. I haven't tracked down
what Cocoa call would be appropriate yet. Hopefully GetGlobalMouse will
continue to work with 1.4.1.

A quick glance leads me to guess that [[NSCursor currentCursor] hotSpot] will return an NSPoint for the current mouse location.

For what it's worth, though, GetGlobalMouse might continue to work. If you decompile it you'll see that the only functions it calls are two private Core Graphics APIs, so it shouldn't be affected by the rest of Carbon. Of course, even if it works today, that's no guarantee that any future implementation of GetGlobalMouse will work.

-Eric

--
Eric Albert email@hidden
http://rescomp.stanford.edu/~ejalbert/
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: cursor position (From: Eric Albert <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.