ignore keypress if key is null or undefined

fixes #4