Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 818 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mouse_Left - any way to emulate? #479934
05/05/20 19:04
05/05/20 19:04
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
I think this is something that should be easy, and I am somehow just missing it ... or it's something so difficult that I would have to write some kind of custom dll to get it to happen.

Is there an way to emulate a mouse click? I can move the mouse pointer with a controller, but I cannot make it so it can click on buttons.

I actually used this code:
Code
if(joy_1)
{
     mouse_left = 1;
}


I know it's not meant to be used that way, but surprisingly it did not crash, and the mouse buttons did respond to it, but just the buttons, it did not call the function.


Last edited by Dooley; 05/05/20 19:04.
Re: Mouse_Left - any way to emulate? [Re: Dooley] #479936
05/05/20 21:20
05/05/20 21:20
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Just include windows.h and use these lines

Code
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
wait(1); //this is mandatory
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);



Last edited by alibaba; 05/05/20 21:20.

Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Mouse_Left - any way to emulate? [Re: alibaba] #479937
05/06/20 03:25
05/06/20 03:25
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
Oh, awesome! Thanks for that. I have never been able to wrap my head around that windows.h thing fully. I should get used to looking into it.


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