Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, howardR), 472 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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