meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
250 stars 44 forks source link

Cleanup keypress handler if set_control overwrites an existing control #130

Closed RussTedrake closed 2 years ago

RussTedrake commented 2 years ago

My Drake code reviewer grilled me about what happens when a second control of the same name is added. This change handles that program flow better; properly deleting the previous keypress handler.

RussTedrake commented 2 years ago

thinking more, I actually like the ability to associate multiple keyboard events with the same button. and the existing code handles that case properly.