(Slightly Off Track) Re: How to get mouse moved events?
(Slightly Off Track) Re: How to get mouse moved events?
- Subject: (Slightly Off Track) Re: How to get mouse moved events?
- From: Henry McGilton <email@hidden>
- Date: Sun, 25 Jan 2004 15:55:44 -0800
On Saturday, January 24, 2004, at 11:36 PM, Public Look wrote:
Thanks for the feedback. I remember a "rulers" application from way
back in NeXTstep.
The well known on NextStep 'Rulers' application was RightBrain Rulers,
by Glenn Reid and Eric Ly. RightBrain Rulers was set up so that it was
always the
topmost application even when it was not the active application.
I think it was probably tied into the Window Server directly back then.
No --- it was just a regular old NextStep application, although some of
the drawing was done using either single operation PostScript function
calls, or PS 'wraps' for more complex drawing.
My current Mac OS X Rulers was inspired by RightBrain Rulers.
The Window Server was partly/mostly a Postscript application and much
of its source was available...
Not so sure about that --- the Display PostScript System is a PostScript
*interpreter* and imaging system, with client-server capabilities. The
only 'source' that was available (if I recall correctly) was the headers
for the server APIs. Adobe were very protective of their intellectual
property.
OK. I am not a graphic designer, but my interest is piqued.
How does a graphic designer use rulers, etc.
I don't entirely know, but people are buying copies for whatever
reasons . . . [1]
Does it matter if the document being edited is scaled/zoomed,
translated, or rotated ?
Yes, which is why I implement scale factors. There is work in progress
to add user-defined
scale factors and user-defined units.
Rotations are more tricky. Currently my application does not do
rotations, although I
have had rotation code in there for some time. There are other (UI)
factors involved
that need thinking through before doing the full rotation options, with
preset rotations
for isometric, di-metric, and tri-metric projections . . . Along
with rotations you
may have to provide options for an automatic scale factor to
foreshorten the rulers
for projections.
Right now in Rulers you can have a cross-hair cursor (several pre-set
sizes and
colours) that follow the mouse around and provide very precise
positioning. The
cross-hairs, at present, are horizontal and vertical. But if you
rotate the
rulers, the horizontal and vertical cross-hairs look just too weird
when the
rulers themselves are at angles. So I am thinking about how to make
this look
sensible.
Don't most graphic design related applications have built in rulers ?
Some do, some don't.
[1] For those ante-diluvian individuals like myself who hand code
their HTML (using
BBEdit in my case), an independent Rulers app helps in measuring
the browser-displayed
results of the editing. An example of a nifty feature in
Trilithon Rulers is a
Percentage of Length 'unit': Many HTML designers lay out elements
as a percentage of
the size of the window, or as a percentage of the width of a table.
Anyway, as to why I would wish to intercept mouse moved events even
when Trilithon Rulers
are not the active application:
1. First off, one customer asked for a cross-hair cursor, plus a
real-time display
(on the ruler body) of the current position of the mouse, relative
to the origins
of the rulers.
2. Then, based on other customers' request that Rulers stay on top
even when not
the active app (just like the old RightBrain Rulers), I had to come
up with a
way to track the mouse position on the screen even when I could not
receive mouse
moved events via the normal responder chain. I achieved this by
using NSTimer
to fire track mouse method calls to get the current mouse position.
My Protractors application uses the same technique . . .
I suppose being able to position translucent rulers anywhere on screen
could be handy, but what do designers use for reference points to
position rulers?
You can nudge them around one pixel at a time with the arrow keys. [2]
What happens when the window of the document being edited is moved
relative to the rulers or the document is scrolled ?
You have to re-position the rulers.
[2] I looked into using the Accessibility API to obtain the window and
view
under the mouse so as to line things up. I have not gone very far
with
this yet.
Don't take up list bandwidth if this is too off topic. This thread
started as a technical question, and now I am twisting it into more of
a why then a how question...
It is somewhat off track, but I also wished to clear up any
mis-understandings.
And besides, you just provided a valuable reference to APIs that I was
unaware of (not knowing to look there in the first place):
So, regarding the technical question: Is the answer to use
CGRemoteOperation.h ?
http://developer.apple.com/documentation/GraphicsImaging/Reference/
Quartz_Services_Ref/index.html
void CGGetLastMouseDelta (CGMouseDelta * deltaX, CGMouseDelta *
deltaY);
CGDisplayMoveCursorToPoint(CGDirectDisplayID display, CGPoint point);
Best Wishes,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden |
http://www.trilithon.com
|
===============================+============================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.