Added ability to handle pressed keys