I suggest putting this in the default on_key_press(). Then you can make Canvas.close_keys a property, which would allow the keys to be configured after the Canvas is created (keeping the init arg is fine too). However, I think the default value should be empty--very inconvenient to have to disable that behavior if you didn't want it, and better to explicitly enable it when you do want it.