The code below produces random values, correcting from the fifth interaction.
It works properly for Windows 7, but for Windows 10 it produces this strange behavior.
Result:
X 422
Y 541
X 519
Y 491
X 496
Y 501
X 500
Y 501
X 500
Y 500
X 500
Y 500
X 500
Y 500
X 500
Y 500
X 500
Y 500
X 500
Y 500
Windows settings:
It works properly for Windows 7, but for Windows 10 it produces this strange behavior.
B4X:
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
For ix = 1 To 10
Move
Next
End Sub
Sub Move()
Dim temp, robot As JavaObject
Dim c3po As AWTRobot
robot = temp.InitializeStatic("com.sun.glass.ui.Application").RunMethodJO("GetApplication",Null).RunMethodJO("createRobot",Null)
c3po.MoveMouse(500, 500)
Dim MouseX, MouseY As Int
MouseX = robot.RunMethod("getMouseX",Null) ' screen co-ordinate not the forms
MouseY = robot.RunMethod("getMouseY",Null) ' as x
Log("X " & MouseX)
Log("Y " & MouseY)
End Sub
Result:
X 422
Y 541
X 519
Y 491
X 496
Y 501
X 500
Y 501
X 500
Y 500
X 500
Y 500
X 500
Y 500
X 500
Y 500
X 500
Y 500
X 500
Y 500
Windows settings:
Last edited: