glue-viz / bqplot-image-gl

Jupyter widget for displaying images with a focus on astronomy
MIT License
19 stars 13 forks source link

Allow filtering of events in MouseInteraction #42

Closed astrofrog closed 3 years ago

astrofrog commented 3 years ago

To avoid too much communication between the frontend and Python in MouseInteraction, I wonder if it might make sense to pre-filter what kind of events one is interested in, e.g.:

interact = MouseInteraction(..., events=['click', 'keydown'])

Otherwise when one is not interested in e.g. move events there is unnecessary constant communication.

maartenbreddels commented 3 years ago

I agree that would be good. But also in light of https://github.com/bqplot/bqplot/pull/1066#issuecomment-781199254 I wonder if this should go upstream, and then move into Figure, and then indeed have similar to ipyevents a list of events one wants to listen to.