Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Auto mouse Click

Author
Message
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 1st Mar 2021 08:48 Edited at: 1st Mar 2021 09:00
Good morning . Is there a way of getting an auto mouse click and to move the mouse coordinates from within the app. Thank you.
Well I've figured out how to move the mouse just got to do the auto click now.

The author of this post has marked a post as an answer.

Go to answer

n00bstar
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: Montreal, Canada.
Posted: 1st Mar 2021 10:27
I'm not sure what you mean by auto mouse click?

In any case, you can check the mouse input with the GetRawMouse commands. You can read about them here: https://www.appgamekit.com/documentation/Reference/Input-Raw.htm

-----------------------------------------------------------------------------
We all got a chicken duck woman thing waiting for us
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 1st Mar 2021 13:05
What I mean is the left mouse button to be clicked by the code rather than by actually pressing the button . Allready looked at the documentation to no avail .
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 1st Mar 2021 13:28
This post has been marked by the post author as the answer.
The command I was looking for was seteditboxfocus()
Thanks for looking .
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 1st Mar 2021 15:19
AppGameKit doesn't strictly have a function for this... in essence you can Get Information from I/O Devices., but not Set Information.
This isn't because it isn't possible to do this., but as a key thing to remember; it's typically a BAD idea to do this.

Now how you go about "Solving" this, really depends on WHY you need this Functionality.



Now as a note., because I'm not creating a Separate "Timer" Routine; this means we can only do this trick once.
It's actually better to create a Type
That keeps the Previous, Current and Delta Time for each Frame; and then put that into an Array that you can update each Individually without using ResetTimer( )
Instead ONLY use ResetTimer( ) whenever the GetMilliseconds() goes above 2 Billion; but note when you do this... also subtract whatever the time was AT that time from all of your Timers "Last Time"
As this will keep them consistent.

Knowing how to and using Timers is absolutely INVALUABLE as a programming tool.

We can do a similar approach for changing the Mouse Position; remember what we want to do is remove the System Pointer., then use our own Sprite when the Mouse is within the App Window.
In this regard we then have FULL control over it's position, rather than having to emulate updates to the Operating System (which is different on each platform)
It's also not as limiting as just using a Mouse either... we can effectively do this with Touch, Joystick, etc. Controls.

Mind I'd say be VERY careful about taking away control from the User., as this can be quite disorientating and make an App feel "Broken" unless it's intention (i.e. part of a Tutorial where the User has no Control)
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 2nd Mar 2021 07:49
Thanks for the reply . I've done what I needed to do .

Login to post a reply

Server time is: 2024-04-19 23:36:40
Your offset time is: 2024-04-19 23:36:40