ignore keypress if key is null or undefined

see issue #4