You use scarcely to emphasize that something is only just true or only just the case.
He could scarcely breathe.
他几乎喘不过气来。
I scarcely knew him.
我几乎不认识他。
You can use scarcely to say that something is not true or is not the case, in a humorous or critical way.
It can scarcely be coincidence.
这决不可能是巧合。
If you say scarcely had one thing happened when something else happened, you mean that the first event was followed immediately by the second.
Scarcely had the votes been counted, when the telephone rang.
选票刚统计好,电话就响了。