Make sure 'keyevent' works if metastate is null.
Merge pull request #1164 from paymand/fix_for_keyevent

Fix for keyevent