There must be something I really don’t understand compared to RealBasic, but how exactly am I supposed to add this MouseDown event to the HTMLViewer control?
My bet, though, is that you could do whatever it is you’re about to do with WebCanvas can be done in Xojo code on a
DesktopCanvas without anywhere near as much waste.
Yes, I forgot to ask, what ius this canvas of which you speak and what has it to do with the Viewer?
The canvas I was referring to is just a HTML canvas, rendering WebGL contents. When clicking in it, it’s supposed to capture the mouse pointer. It does in a regular web browser, but it does not in the Xojo HTMLViewer.
Xojo does not interrupt or capture the mouse. Here is an example project that shows this: Download js_click.xojo_xml_project
That said, (Desktop)HTMLViewer does not implement everything a browser does. There may very well be things that just don’t work. Have you tried looking for a more appropriate tool to build your project?
Hmm, I’m not actually sure about that specific need. I know that a browser can’t hold my mouse hostage unless it’s in fullscreen mode, and I’m not sure fullscreen mode is something that works within the XojoHTMLViewer universe. The people who have tried to wrap streaming services might know more about if that’s possible.
That’s false. Fullscreen has its own JS API. requestPointerLock() is independant from fullscreen. The fullscreen API is requestFullscreen()
Good luck with your project, I was only trying to point out failure points I could foresee.
I wasn’t thinking about clicking inside a canvas to provide it that privilege.
I knew I shouldn’t have said anything.
Thanks for the name calling I guess? If what you post is false, then it’s false, like there’s no need to be offended by a simple fact. And don’t you forget that I’m one of the TWO new users of the month who deserved a badge!
This doesn’t appear to work for an HTMLViewer. Not even sure why it’s offered.
It’s not what you say, it’s how you say it.
OK well I’m sorry man! I didn’t mean to offend anybody? I appreciate the help, always! EVEN YOURS!
Can we go back to the topic now?
So basically, we’re not aiming for going fullscreen. We’re aiming for capturing the mouse pointer so that we can infinitely move the cursor in any direction without hitting the border of the screen. That’s what the JS counterpart does and that’s what I need to mimick in Xojo to be able to pass the mouse X/Y deltas to JS to mimick what requestPointerLock() is doing natively in a real web browser.
HTMLViewer is not fully implemented to support every API you expect in a browser. Anything that requires user approval like location, camera, microphone, notifications, etc. just won’t work. I haven’t investigated the API you want to use myself, but if it typically requires user approval, it probably just won’t work.
There’s probably a way you could implement this with Xojo’s HTMLViewer, just maybe not using that API.
Well, abstractly, you’d need to lock the mouse to a screen position, get notified of changes to position, then send that to the viewer to raise the mouse move event on the canvas node.
I’ve never had a need for manipulating the cursor like this and usually consider it bad form, so I can’t be more specific.