Preventing default after capturing keyboard event.