I have forgot something...

im trying to understand the selection/picking method, so i have created a stupid program displaying only a quad on the screen.

my objective is:

if (u_clicked_on_quad) { tell_me(YES);}
else { tell_me(NO)};

it seem to “half” work.
the problem is this :
-i start to click on an empty area it say NO (OK)
-the first time i click on the quad it say Yes (OK)
-now if i click on an empty area it continue to say YES (WRONG)

basically my main loop do this :

draw scene;
if (mouse pressed){i_get_mouse_x&Y;

so i think to have forgot somenthing or i cant understand something.

thanks in advance for help.