SSH has no way of knowing when a password is being typed. It can happen any time within the session after SSH auth.