I don’t think it’s possible with the current API, but you can register global handlers for keyup/keydown, store currently held keys and get this information from within a Bokeh CustomJS callback.
Regards,
Eugene
···
On Friday, November 10, 2017 at 11:27:10 PM UTC+7, Eugene Pakhomov wrote:
On Friday, November 10, 2017 at 4:26:51 PM UTC+7, Raffs Walker wrote:
Hello,
Is there way to check for KeyDown in plot js events?
I would like to know if Shift-Key is pressed.
E.g.
plot = Figure()
callback = CustomJS(args={},
code="""
console.log('Callback');
// Does not work!!!
console.log(window.event.shiftKey);
""")
plot.js_on_event(events.SelectionGeometry, callback)
Raphael
To post to this group, send email to [email protected].
To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/e2607111-389d-438e-ac3c-d950320dfd9f%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/e2607111-389d-438e-ac3c-d950320dfd9f%40continuum.io?utm_medium=email&utm_source=footer).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).