added keyboard press event handling for the canvas