Added custom key events for previous, next and cancel