glue-viz / bqplot-image-gl

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

feat: keydown/keyup event support #41

Closed maartenbreddels closed 3 years ago

maartenbreddels commented 3 years ago

this gives us keydown and keyup event support, similar to ipyevents we grab focus when the mouse moves into the div element of the Figure. Note that we also send the last mouse coordinates with the key events.

codecov[bot] commented 3 years ago

Codecov Report

Merging #41 (1fc611a) into master (86cdf30) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #41   +/-   ##
=======================================
  Coverage   61.05%   61.05%           
=======================================
  Files           5        5           
  Lines          95       95           
=======================================
  Hits           58       58           
  Misses         37       37           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 86cdf30...1fc611a. Read the comment docs.

pllim commented 3 years ago

So, just to be clear, this is only enables the up/down key? Any plans to let dev define arbitrary key in the future? Just wondering.

pllim commented 3 years ago

Key combo (Emacs style) could also be useful but might be naturally solved by arbitrary binding?

maartenbreddels commented 3 years ago

There is nothing more than up/down AFAIK, there used to be a 'keypress' event but that is deprecated. Key combinations should be implemented on the Python side.

pllim commented 3 years ago

By Python side, do you mean in glue-jupyter?

maartenbreddels commented 3 years ago

By Python side, do you mean in glue-jupyter?

Yes, or any other Python program that uses bqplot-image-gl. Does that make sense?

pllim commented 3 years ago

Yes, @astrofrog has clarified for me. Thanks!