fixed bug in KeyEvents.js