Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to warp the mouse pointer position

Subject: How to warp the mouse pointer position

From: Leandra Vicci

Date: 2 Jan, 2009 13:42:02

Message: 1 of 3

I wish to snap the mouse pointer to the exact coordinates of a known point in the active axes. X Windows has a function for such purposes, but I can't find an equivalent Matlab graphics function. Does one exist? If not, are there primitives I could use to write one? The axes CurrentPoint, CurrentPoint.x, and CurrentPoint.y properties are read-only, so I can't just set them.

Subject: How to warp the mouse pointer position

From: Jiro Doke

Date: 2 Jan, 2009 16:47:01

Message: 2 of 3

"Leandra Vicci" <vicci@cs.unc.edu> wrote in message <gjl5j9$acj$1@fred.mathworks.com>...
> I wish to snap the mouse pointer to the exact coordinates of a known point in the active axes. X Windows has a function for such purposes, but I can't find an equivalent Matlab graphics function. Does one exist? If not, are there primitives I could use to write one? The axes CurrentPoint, CurrentPoint.x, and CurrentPoint.y properties are read-only, so I can't just set them.
>

You can use the 'PointerLocation' property of the root (0), in conjunction with figure position and axes position.

jiro

Subject: How to warp the mouse pointer position

From: Leandra Vicci

Date: 2 Jan, 2009 17:18:02

Message: 3 of 3

"Jiro Doke" <jiro.doke@mathworks.com> wrote in message <gjlge5$r86$1@fred.mathworks.com>...
> "Leandra Vicci" <vicci@cs.unc.edu> wrote in message <gjl5j9$acj$1@fred.mathworks.com>...
> > I wish to snap the mouse pointer to the exact coordinates of a known point in the active axes. X Windows has a function for such purposes, but I can't find an equivalent Matlab graphics function. Does one exist? If not, are there primitives I could use to write one? The axes CurrentPoint, CurrentPoint.x, and CurrentPoint.y properties are read-only, so I can't just set them.
> >
>
> You can use the 'PointerLocation' property of the root (0), in conjunction with figure position and axes position.
>
> jiro
YES! It works perfectly. Thanks, Jiro.
Sincerely,
    -- Lea

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us