Posted: 1st Mar 2021 8:48
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.
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
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 .
Posted: 1st Mar 2021 13:28
The command I was looking for was seteditboxfocus()
Thanks for looking .
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.

+ Code Snippet
do
    Print( ScreenFPS() )
    Print( GetMilliseconds() )
    
    If GetMouseClick( 2, 250 ) // Right-Click, every 1/4 Second
    	DrawBox( 10, 10, 250, 250, MakeColor( 255, 0, 0 ), MakeColor( 255, 0, 0 ), MakeColor( 255, 0, 0 ), MakeColor( 255, 0, 0 ), 1 )
    Else
    	DrawBox( 10, 10, 250, 250, MakeColor( 32, 32, 32 ), MakeColor( 32, 32, 32 ), MakeColor( 32, 32, 32 ), MakeColor( 32, 32, 32 ), 1 )
    EndIf
    	
    Sync()
loop

Function GetMouseClick( Button As Integer, Frequency As Integer )	
	Select Button
		// Button Left
		Case 1 :
			If GetRawMouseLeftState()
				If ( GetMilliseconds() > Frequency )
					ResetTimer()
					ExitFunction -1
				EndIf
			EndIf
		EndCase
		// Button Right
		Case 2 :
			If GetRawMouseRightState()
				If ( GetMilliseconds() > Frequency )
					ResetTimer()
					ExitFunction -1
				EndIf
			EndIf
		EndCase
		// Button Middle / Wheel
		Case 3 :
			If GetRawMouseMiddleState()
				If ( GetMilliseconds() > Frequency )
					ResetTimer()
					ExitFunction -1
				EndIf
			EndIf
		EndCase
		// Button Back
		Case 4 :
			If GetRawMouseFourthState()
				If ( GetMilliseconds() > Frequency )
					ResetTimer()
					ExitFunction -1
				EndIf
			EndIf
		EndCase
		// Button Forward
		Case 5 :
			If GetRawMouseFifthState()
				If ( GetMilliseconds() > Frequency )
					ResetTimer()
					ExitFunction -1
				EndIf
			EndIf
		EndCase
		// All other Conditions than 1 - 5
		Case Default :
			Exit
		EndCase
	EndSelect
	
	// This should never be reached
EndFunction 0


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)
Posted: 2nd Mar 2021 7:49
Thanks for the reply . I've done what I needed to do .