Improved KeyPressEvent Class