Border condition handling in keydown event.