Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 521 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simulate mouse clicks #459232
04/30/16 07:58
04/30/16 07:58
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline OP
Expert
alibaba  Offline OP
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
How do I simulate mouse clicks in 3DGS?
I tried everything winAPI wise, it seems like Acknex has no event set for simulated mouse clicks.

Neither sys_message, nor SendMessage works. Also mouse_event doesn't work. PostMessage as well. I'm helpless.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Simulate mouse clicks [Re: alibaba] #459234
04/30/16 10:17
04/30/16 10:17
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
No idea what you did, this works perfectly fine for me.
Code:
while(1)
{
	if(key_l)
	{
		mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_ABSOLUTE, 0, 0, 0, 0);
		wait(1);
		mouse_event(MOUSEEVENTF_LEFTUP | MOUSEEVENTF_ABSOLUTE, 0, 0, 0, 0);
	}
	
	wait(1);
}


Re: Simulate mouse clicks [Re: Ch40zzC0d3r] #459235
04/30/16 10:23
04/30/16 10:23
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline OP
Expert
alibaba  Offline OP
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Wow, I didn't know I had to use MOUSEEVENTF, but you're right, your code works!
Thank you very much!


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Simulate mouse clicks [Re: alibaba] #459236
04/30/16 10:27
04/30/16 10:27
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
MOUSEEVENTF is used so I dont have to get the current mouse pos.
The x and y coords will be relative to the cur mouse pos which means passing 0 wont change the mouse pos at all.

I guess you simply forgot to put a wait(1) between because this way the engine wont register any click but will stop any real mouse clicks from happening laugh

Re: Simulate mouse clicks [Re: Ch40zzC0d3r] #459237
04/30/16 10:35
04/30/16 10:35
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline OP
Expert
alibaba  Offline OP
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
You're right, it really was the wait(1) crazy


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Simulate mouse clicks [Re: alibaba] #459316
05/07/16 08:21
05/07/16 08:21
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
alibaba, you can send clicks also with using the combined mouse-down, mouse-up events in mouse_event function. Also the wait(1) shouldn't be necessary.
Why do you want to simulate a mouse click?


Visit my site: www.masterq32.de
Re: Simulate mouse clicks [Re: MasterQ32] #459317
05/07/16 08:27
05/07/16 08:27
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline OP
Expert
alibaba  Offline OP
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
To click Panel Buttons using a Joystick. I set the mouse pos to the next button and simulate the mouse click in order to run the button event. Maybe it's also possible to make all buttons seperate panels but that would be too much rework of the code.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de

Moderated by  old_bill, Tobias 

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