added key events for the print function