added support for keypresses