change event handler for keyboard events using swich statements