you should be able to replace all of this with a call to fluid.activatable. I believe you should be able to just use the default keybindings so fluid.activatable(element) should be enough. You should be able to do this declaratively, probably as a listener to the appropriate creation event.