T TheSirOwl New Member Licensed User Longtime User Apr 5, 2014 #1 My daughter is learning to program in Java and just wrote a program for eyes to follow the mouse position. I would like to try the same thing here in B4J. How do I read the pointer position when it is in a UI or Panel
My daughter is learning to program in Java and just wrote a program for eyes to follow the mouse position. I would like to try the same thing here in B4J. How do I read the pointer position when it is in a UI or Panel
derez Expert Licensed User Longtime User Apr 5, 2014 #2 Example for a panel named anchor : Code: Copy Sub anchor_MouseMoved (EventData As MouseEvent) Log(EventData.X & " " & EventData.Y) End Sub Upvote 0
Example for a panel named anchor : Code: Copy Sub anchor_MouseMoved (EventData As MouseEvent) Log(EventData.X & " " & EventData.Y) End Sub
FrenchDeveloper Member Licensed User Longtime User Jun 6, 2014 #3 Hello, It seems it doesn't work when the panel is transparent It works when I remove these lines : MainForm.SetFormStyle("TRANSPARENT") MainForm.BackColor = fx.Colors.Transparent May be I'm wrong but I think it may be possible to get the absolute mouse position from the screen and not from an object Upvote 0
Hello, It seems it doesn't work when the panel is transparent It works when I remove these lines : MainForm.SetFormStyle("TRANSPARENT") MainForm.BackColor = fx.Colors.Transparent May be I'm wrong but I think it may be possible to get the absolute mouse position from the screen and not from an object
Erel B4X founder Staff member Licensed User Longtime User Jun 8, 2014 #4 See the code posted here: http://www.b4x.com/android/forum/threads/how-to-move-an-undecorated-form.37551/#content Upvote 0
See the code posted here: http://www.b4x.com/android/forum/threads/how-to-move-an-undecorated-form.37551/#content
FrenchDeveloper Member Licensed User Longtime User Jun 8, 2014 #5 Erel said: See the code posted here: http://www.b4x.com/android/forum/threads/how-to-move-an-undecorated-form.37551/#content Click to expand... Thank you Erel, I copy here the part of code which is particularly concerned : Code: Copy Dim jo As JavaObject = EventData Mouse_x = jo.RunMethod("getScreenX", Null) Mouse_y = jo.RunMethod("getScreenY", Null) Upvote 0
Erel said: See the code posted here: http://www.b4x.com/android/forum/threads/how-to-move-an-undecorated-form.37551/#content Click to expand... Thank you Erel, I copy here the part of code which is particularly concerned : Code: Copy Dim jo As JavaObject = EventData Mouse_x = jo.RunMethod("getScreenX", Null) Mouse_y = jo.RunMethod("getScreenY", Null)