Change back to keyup, but with improved parsing