Controlling the mouse/keyboard

My use case is that I’m making an autoclicker (half for funsies and half to learn how to make good desktop apps). I need to be able to control the mouse, but I can’t seem to find anything in the documentation about that. Is this possible?

Edit: I’d like to mention that I have everything in my autoclicker complete except for the actual clicking part. That has been replaced by a DebugLog for now.

Have you looked at the mouse events? You can add events by right clicking on your window in a Desktop App.

I know how to use events, yes. I am using them all over my application. Everything in this, including variable clicks per second, has been implemented. All I need to do is make the user’s mouse click, not listen for when they click it, if you catch my drift.

1 Like

Monkeybread has a computercontrol plugin, that’s the only way to control a hser’s computer. Note that it’s a bad thing to do!

I do agree that controlling someone’s computer without explicit permission is a bad thing to do.
But, a program with the main purpose of controlling the user’s computer sounds like pretty explicit permission to me.
Anyways, I’ll try that out and mark your post as the solution for now. Many thanks!

Edit: Just realized that this plugin costs $59; there must be a way to control the user’s mouse without paying an extra $59. This is not an answer. I will write my own plugin if I have to.

The price of the MBS complete plugin is the cheapest you’ll ever find for what you get.

You can always build your own way you are totally free to do so. I’ve just recommended it cause 1-2 hours of work is about the same price as the MBS complete plugin. I think it’s worth the investment over how much time you’d spend.

Anyway i don’t know of ANY other way then MBS or your own plugin, which may take a long time to create…

Maybe if your are a student or a small business you can ask @Christian_Schmitz for a discount?

You need this on MacOS, Windows or Linux ? @Brandon_Bothell

1 Like

I am a student, and that’s why I want to make my own plugin. Though, now I have problems with that, so I’ll be making another post here shortly with some questions.

Rather than wrestle with the intricacies of writing a plugin, just call the Declares directly.

3 Likes

Ohhh now this looks nice. The only problem I have is that I’m calling the SendInput function from winuser.dll, which includes a parameter that is a pointer to an object. How would I create this object in Xojo?

Use the window or control’s Handle property. Or if it’s a different app, you’d have to look it up. FindWindow, etc.

https://documentation.xojo.com/api/data_types/additional_types/ptr.html

https://documentation.xojo.com/api/data_types/additional_types/ptr.html#ptr-structure

I ended up making my own plugin. Wasn’t too hard, fun learning experience.

3 Likes