use capture instead of check onkeydown attr
Fix wrong direction bug