You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current behaviour of the CameraControl keyboard listeners is to react on keyboard keydown events only if the mouse is over the canvas. (here and here)
This does not suit me because I am developing an interface where a lot of stuff appear above the canvas:
It happens very often that the mouse is overing one of the UI parts and not directly the canvas. In this cases, I would like to keep the keyboard updating the camera.
I have two solutions for this and would like to know if one of these appears to be the right one in your opinion.
SOLUTION 1: (simplest)
Adding a CameraControl config that allows to react to keyboard keydown events even if the mouse is not overing the canvas. Something like: (to add here and here)
Adding a CameraControl config that allows to react to keyboard keydown events if the mouse is overing another DOMElement that the canvas. In my usecase, the xeokit viewer canvas and the UI parts are children of the same div element. To be able to specify this div could limit the keyboard listeners to react only if the mouse is overing a part of the window UI but not only the canvas.
One implementation could be to change the canvas of the MouseMiscHandler file into something like:
The current behaviour of the CameraControl keyboard listeners is to react on keyboard
keydown
events only if the mouse is over the canvas. (here and here)This does not suit me because I am developing an interface where a lot of stuff appear above the canvas:
It happens very often that the mouse is overing one of the UI parts and not directly the canvas. In this cases, I would like to keep the keyboard updating the camera.
I have two solutions for this and would like to know if one of these appears to be the right one in your opinion.
SOLUTION 1: (simplest)
Adding a CameraControl config that allows to react to keyboard
keydown
events even if the mouse is not overing the canvas. Something like: (to add here and here)With a default to
true
for retro-compatibility.SOLUTION 2:
Adding a CameraControl config that allows to react to keyboard
keydown
events if the mouse is overing anotherDOMElement
that the canvas. In my usecase, the xeokit viewercanvas
and the UI parts are children of the samediv
element. To be able to specify thisdiv
could limit the keyboard listeners to react only if the mouse is overing a part of the window UI but not only thecanvas
.One implementation could be to change the
canvas
of the MouseMiscHandler file into something like:But this solution brings more complexity into the code and the naming have to be perfect.
I'd be glad to hear what you think @xeolabs.
The text was updated successfully, but these errors were encountered: