napari / docs

Documentation for napari (other than API docs)
BSD 3-Clause "New" or "Revised" License
9 stars 37 forks source link

Expand keypress events guide #413

Open psobolewskiPhD opened 2 months ago

psobolewskiPhD commented 2 months ago

🧰 Task

Expand this section: https://napari.org/dev/howtos/extending/connecting_events.html#listening-for-keypress-events

To also include an example using a layer, e.g. Image.bind_key -- this will fire on a selected Image layer Or even a specific layer, like viewer.layers['my layer'].bind_key -- this will only fire if that layer is selected

It may be worth updating the example (https://github.com/napari/napari/blob/main/examples/custom_key_bindings.py) as well.