added some prototyped key event handling