Skip to content

Request to add set_on_key for open3d.visualization.O3DVisualizer in Python #7226

Open
@m-shahbaz-kharal

Description

@m-shahbaz-kharal

Checklist

Proposed new feature or change

open3d.visualization.O3DVisualizer is an amazing out-of-box class as it provides many built-in features, however, there's no option for developers to add custom keyboard key handling to it. It is, therefore, requested that set_on_key should be exposed. I believe it is simple and clutter free to include this feature as open3d.visualization.O3DVisualizer inherits from open3d.visualization.gui.Window that has SetOnKeyEvent, so adding something like following to cpp/pybind/visualization/o3dvisualizer.cpp under pybind_o3dvisualizer_definitions should work just fine:

.def("set_on_key", &O3DVisualizer::SetOnKeyEvent,
     "Sets a callback that will be called when a key is pressed. "
     "The callback will be given the key event and should return "
     "True if the event was handled, or False if it was not.",
     "callback"_a);

References

No response

Additional information

I previously only used pip package of Open3D, so please let me know if this solution is not ideal or against design principles of Open3D.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions