if(mouse_right) { while(mouse_right == 1){ wait(1);} while(mouse_right == 0){ wait(1);} }
#define CLICK_RATE 0.3 // Rate for the click double var VL_time_passed = 0; var doubleclick_right = 0; if(mouse_right) { while(mouse_right){wait(1);} VL_time_passed = 0; while(VL_time_passed < CLICK_RATE) { if(mouse_right) { doubleclick_right = 1; // action if the double click is made } VL_time_passed += time_step / 16; wait(1); } } else { doubleclick_right = 0; }
#include <acknex.h> #define MC_DOUBLECLICKTIME 4 var nMouseLeft = 0; void on_mouse_left_event () { nMouseLeft = 1; } function main () { mouse_mode = 4; wait(1); var nMouseClock = 0; while ( 1 ) { if ( nMouseClock ) { if ( nMouseLeft ) { nMouseClock = 0; nMouseLeft = 0; error ( "Double click" ); } else { nMouseClock = maxv ( nMouseClock - time_step, 0 ); if ( nMouseClock == 0 ) { error ( "Single click" ); } } } else if ( nMouseLeft ) { nMouseClock = MC_DOUBLECLICKTIME; nMouseLeft = 0; } wait(1); } }
Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy
oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de