Implement key event handlers and compositions.