Added support for keyboard events.