Added keyboard event handling to new ButtonEditDialog. More refactoring