LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i do multible left click events?

hey,

 

I'm tring to create a basketball game, and I don't know how I can make two diffrent events with event_left_click_up on the same callback function.

to furthue explain,

I want to click on the canvas and then a power bar will start running

second click on the same canvas will stop it and the ball will start moving.

 

thank u all in advance

 

barak

 

0 Kudos
Message 1 of 2
(3,129 Views)

One possible solution could be to use a variable that is toggled between 0 and 1:

 

 

switch ( event )

{     case EVENT_LEFT_CLICK_UP:

        if ( !toggle )

        {

            // start running

        }

        else

        {

            // stop running

        }

        toggle = !toggle;

        break;

}

 

0 Kudos
Message 2 of 2
(3,115 Views)