Provide the charCode only for keypress.