Added two samples for working with key events.