Hello all,
I have a figure in which I use ginput() to have coordinates. I ask the user to use left click, right click or keyboard's space in order to have coordinates of three specifics points. But ginput doesn't respond to any keyboard input till I click on the axes. After the first click it will accept all keyboard inputs.
My code:
[clicX, clicY, clicButton] = ginput(1); while isempty(clicButton) ~= 1 % ENTER to quit
switch clicButton case 1 % Left click
... case 2 % Right click
... case 32 % SPACE key
... end [clicX, clicY, clicButton] = ginput(1); end
I try to add figure(handle) before ginput() in order to Matlab to focus, but whithout any results.
Is someone have a solution ?
Thanks
Best Answer