fix a bug of keydown