Change format to a better single handler for key events