how to use a controler as a mouse

Posted By: janerwac13

how to use a controler as a mouse - 11/27/10 22:30

My question how to use a controller as a mouse.
with the right analog stick you're moving the cursor and with A you "click".Dont know how to write this.
I tried it but i failed many times !
i hope u can help me. thx
Posted By: JibbSmart

Re: how to use a controler as a mouse - 11/27/10 22:40

If you #include <windows.h> you can use the GetCursorPos and SetCursorPos functions to find and change the mouse position (respectively). If you google them, you'll see what kind of parameters they need.

You can use:
Code:
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);


to send a mouse-click, but don't forget to also use:
Code:
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);


to simulate letting go of the mouse afterwards.

As long as you know how to get input from the controller, that should get you all set up.

Superku taught me those tricks, and I found them very useful for my game laugh

Jibb
Posted By: janerwac13

Re: how to use a controler as a mouse - 11/27/10 22:49

How must i write this ?
Posted By: JibbSmart

Re: how to use a controler as a mouse - 11/28/10 13:42

Do you know how to use a controller at all?

Jibb
© 2024 lite-C Forums