Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to create double mouseClick and mouseClick Event for Game #405384
07/30/12 04:51
07/30/12 04:51
Joined: Dec 2009
Posts: 128
China
frankjiang Offline OP
Member
frankjiang  Offline OP
Member

Joined: Dec 2009
Posts: 128
China
How to create double mouseClick and mouseClick Event for Game?
is it possible to this thing?
any good guys have good idea for this topic?any one know?


development 3d game is interesting!
Re: How to create double mouseClick and mouseClick Event for Game [Re: frankjiang] #405387
07/30/12 08:32
07/30/12 08:32
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Code:
int nMouseClickedOnce = 0;
int nMouseClickedTwice = 0;

void mouseClick()
{
   int nWaitTime = 200;
   if (nMouseClickedOnce == 0)
   {
      nMouseClickedOnce = 1;
   }
   else
   {
      nMouseClickedTwice = 1;
   }
   while(nWaitTime > 0)
   {
      nWaitTime -=1;
      wait(1);
   }
   nMouseClickedOnce = 0;
   nMouseClickedTwice = 0;
}

void test()
{
   on_mouse_left = mouseClick;
   if (nMouseClickedTwice)
   {
      printf("Mouse clicked twice");
   }
}



Re: How to create double mouseClick and mouseClick Event for Game [Re: PadMalcom] #405399
07/30/12 10:52
07/30/12 10:52
Joined: Dec 2009
Posts: 128
China
frankjiang Offline OP
Member
frankjiang  Offline OP
Member

Joined: Dec 2009
Posts: 128
China
Thank you for your code, guys!


development 3d game is interesting!
Re: How to create double mouseClick and mouseClick Event for Game [Re: PadMalcom] #405400
07/30/12 10:59
07/30/12 10:59
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
or everything inside a loop

Code:
var nMouseLeft = 0;

while ( 1 )
{
	if ( mouse_left )
	{
		if ( !nMouseLeft )
		{
			nMouseLeft = MC_DOUBLECLICKTIME;
		}
		else if ( nMouseLeft < 0 )
		{
			nMouseLeft *= -1;
			
			printf ( "Double click" );
		}
	}
	else if ( nMouseLeft )
	{
		if ( nMouseLeft < 0 )
		{
			nMouseLeft = minv ( nMouseLeft + time_step, 0 );
			
			if ( !nMouseLeft )
			{
				printf ( "Simgle click" );
			}
		}
		else if ( nMouseLeft == MC_DOUBLECLICKTIME )
		{
			nMouseLeft *= -1;
		}
		else
		{
			nMouseLeft = 0;
		}
	}
	
	wait(1);
}



Salud!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1