how to wait for mouse press without figure or gui?

3 Ansichten (letzte 30 Tage)
zohar
zohar am 11 Feb. 2015
Kommentiert: zohar am 16 Feb. 2015
Hi all,
I need to capture a small rectangle region of screen that defined by the user.
I need a way to get from the user two pointer location.
How do I do that without figure or gui ?
should be something like:
% wait for mouse press and released
p1 = get(0, 'PointerLocation');
% wait for mouse press
while mouse not released
p2 = get(0, 'PointerLocation');
%draw rectangle window on screen
pause(0.5)
end
capture window.
I'm open for any suggestions even java.awt.Robot/java.awt.MouseInfo
Thx
  2 Kommentare
Geoff Hayes
Geoff Hayes am 15 Feb. 2015
Zohar - is the screen a MATLAB figure or is it outside of the MATLAB environment?
zohar
zohar am 16 Feb. 2015
Hi Geoff,
I need the mouse location outside matlab environment.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by