Make sure to pass the variables correctly for 'keyevent'.
Merge pull request #1158 from paymand/fix_for_keyevent

Make sure to pass the variables correctly for 'keyevent'.