ipyevents icon indicating copy to clipboard operation
ipyevents copied to clipboard

Cannot use input widgets whilst listening to keyboard events

Open agoose77 opened this issue 5 years ago • 1 comments

This might only apply to the FloatText/IntText, but I assume it might be a broader issue.

By calling preventDefault on the widget, we lose the ability to enter values into widgets.

https://github.com/mwcraig/ipyevents/blob/b6a94c7588f071118fa27cb5b7e9f4aacca9ef5d/src/events.ts#L268-L269

Perhaps a solution here would be to enable a list of keycodes that are either ignored, or always blocked. I was thinking otherwise the Python event handler could veto the blocking, but that would add the roundtrip time to each event :vomiting_face:

agoose77 avatar Sep 16 '20 10:09 agoose77

I'm not quite sure what to do about this. The original motivation for this was to make sure that handlers for keyboard events didn't have to worry about colliding with the default notebook keyboard shortcuts (I had particular issues with d``d colliding with a handler I was working on.

Is your case that the text widget is the one whose events you are watching or is it that a text widget is inside some other, larger, widget that you are handling events for?

mwcraig avatar Jul 08 '21 16:07 mwcraig