Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Add callbacks for mouse/key events in gui.SceneWidget on the Python side

Open prewettg opened this issue 6 years ago • 3 comments

C++ can subclass gui::SceneWidget to override mouse and keyboard events; Python needs to have access to this, too. Having mouse and key events would enable things like:

  • changing the key navigation if you have an international keyboard (#1893)
  • custom editing of selected points (#1965)
  • synchronize cameras with multiple SceneWidgets (#999, see last comments)
  • showing the current mouse coordinate (there was an issue for this, but I can't find it)

prewettg avatar Nov 12 '20 18:11 prewettg

Hi, @prewettg thanks for this contribution. Can we now use set_on_mouse or set_on_key for a o3d.visualization.O3DVisualizer in python? That would be very useful for people who want a quick shortcut key binding but do not want to completely re-write other widgets.

heiwang1997 avatar Apr 09 '21 09:04 heiwang1997

@heiwang1997 Our original thinking was that actions should take care of this case: you can add a callback function and you get a button at the bottom of the window and a menu item. The menu item should have a shortcut, which seems like it would solve your problem, but unfortunately the Dear ImGui library we are using for the UI doesn't support shortcuts at the moment (except on macOS because we use the native calls). If that would not be sufficient for your use case, please open a new issue, describe it, and assign to me.

prewettg avatar Apr 12 '21 19:04 prewettg

I would be really interested in this as well. I created a new issue for this, but was not able to assign it to @prewettg in it.

masmu-3di avatar Nov 20 '21 22:11 masmu-3di