Add keyEvents and other improvements