There has been a lot of discussion and demand for mouse events in Xojo Web 2.0. I think Xojo is bringing them back for Canvas, but I wrote a class to bring mouse events to any WebControl (even WebPages).
Introducing TP_WebMouse
TP_WebMouse fills the need for mouse events on any control in Xojo Web 2.0. The class can track move, click, enter, and exit events. These events are sent to the server for developers to handle any way they like.
This seems like a spectacular solution to a problem that exists, but shouldn’t exist.
If I end up building any Web 2.0 apps (which is a huge IF based on my experience with it so far), I will undoubtedly purchase this–but the fact that it isn’t built-in as it was in 1.0 is truly mind-boggling to me. I could understand having it disabled by default requiring specific events to be enabled as-needed, but removing the capability is still unfathomable to me as it assumes use-cases that just aren’t remotely universal.
If my future corporate intranet apps (where latency isn’t an issue) are built using Web 2.0, you’ll be getting my money. If my future apps with public access are built using Web 2.0 but need a particular event tracked for specific functionality despite the risk of latency issues, you’ll be getting my money.
I haven’t seen as much interest / need for this functionality so I hadn’t looked into it. I know the framework traps the tab key in an awkward way, so I’'m not immediately certain if it’s possible.
This listens for the Javascript events mousedown, mouseenter, mouseleave, and mousemove specifically. As I look it up, touch events are their own thing. I could certainly add touch events.
It raises the question should the touch events be tracked automatically with the click events, or should they be their own option?
The CanIUse for TouchEvent doesn’t indicate Safari iOS support o.O
I believe jQuery Touch Punch is typically used. I’m not sure if Xojo included the jQuery mobile stuff with their stack. I personally would like to see a single PressedEvent and have the event Object provide information such as if it was a touch or mouse click, and details such as which button or how many fingers were used etc…
Hi Tim,
I just bought your mouseevents tool, i haven’t tested it but i already have a question:
Can i adjust the time between 2 readings of the events, there can be a rather big difference in webtraffic if it is local or via external web. Therefor it could be handy to be able to change the timing.
Oh… and don’t wait to long to release also key- and touch-events module, i am sure there is interest for that too!
Yes, i meant this one, I asked the question right after download without testing and i hadn’t read anything about the possibility to adjust, but in the meantime i found where to do that.
Anyway thanks for your efforts to find this out and inform me.
Andre
Hey sorry about the delay in response. I’m catching up from falling ill this week.
The 200ms time is adjustable. It’s a variable in the Javascript (the demo script is obfuscated, but the purchase comes with the source). My original goal was to make this adjustable from within Xojo. I am waiting on Web2SDK documentation to see how I’m supposed to go about updating this.
I would expect that with more documentation I can flesh this tool out to be a little more useful.