how to wait for mouse press without figure or gui?

조회 수: 3 (최근 30일)
zohar
zohar 2015년 2월 11일
댓글: zohar 2015년 2월 16일
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
Geoff Hayes
Geoff Hayes 2015년 2월 15일
Zohar - is the screen a MATLAB figure or is it outside of the MATLAB environment?
zohar
zohar 2015년 2월 16일
Hi Geoff,
I need the mouse location outside matlab environment.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by