[quote=115467:@Bob Keeney]Using MouseMove is not a good idea. In a debug app you have next to zero latency so it appears smooth. On an outside web server MouseMove is a sure way to drown your app in events and make it unresponsive.
Remember that ALL events are processed on the server. Move your mouse a single pixel and it sends an event to the server for processing. Now move your mouse all over the place and you’ve got hundreds of events that get sent to the server.[/quote]
I am aware MouseMove can generate a lot of traffic. However, I see very little other solutions in Xojo code to detect the position of the cursor on the screen to move an object.
Now, I am not sure MouseMove is so dangerous that the mere mention of it condemns an app to be hanged and doomed. Here is my reasoning to alleviate the issue, please don’t scream and hear me out.
Let use consider the drag and drop action from UI display side for an instant. For all intents and purposes, a user sees changes occurring every 1/60 th a second as a continuous move. Translated to microseconds intervals, it gives 1,000,000 divided by 60, equals 16,666. So for the user to see smooth, displaying the moving object every 16,666 microseconds is enough. MouseMove indeed fires at every pixel position change. For a quick swipe across 1600 pixels in a quarter a second, the interval is 156 microseconds. I believe that the code I posted to move an object would work fine if it was executed only every 60 th a second and look smooth to the user. So in essence to preserve processing time for the app and not overwhelm it with MouseMove, execute it only at 16,666 microseconds interval. It should give the app ample time to do quantities of other things, prevent drowning and preserve responsiveness. By introducing time resolution into the execution of the event we insure the preservation of processing power. Sure, network incidents and transmission delays could disrupt that rosy picture but given the average quality of Internet today, it should not be too much of a problem.
I am going to create a test project and experiment around that concept on my host in NY. From Paris, the network conditions should be realistic enough between client and server to see if indeed responsiveness becomes an issue with the technique I described. I am confident a drag and drop can be implemented that way. If it does not work, I promise to report and make amends.
The only lighter alternative I see is to use JavaScript through a code such as what Brock Nash posted which would execute in the client, then use a WebDSK interface to send back JavaScript event values and variables to Xojo. But that becomes a bit more complex than regular Xojo programming. But hey, it still maybe ready much before xojo implements the feature as mentioned by Geoff