しているときに

while doing

→ 為る
phrase Uncommon #13,366
while doing Used to describe something happening while an action is in progress. The exact timing depends on the verb and context.
JA: 勉強しているときに電話が鳴った。
EN: The phone rang while I was studying.

私はフットボールをしているときに脚を痛めた。

I injured my leg while playing football.

学校へ行く途中で通りを横断しているときに事故に遭った。

I was in an accident while crossing the street on my way to school.

彼は人々が興奮しているときにはいつも離れている。

He always keeps his distance when people get excited.

私は今朝、道路の雪かきをしているときに滑ってけがをしてしまった。

I slipped and injured myself while shoveling snow off the road this morning.

彼は散歩しているときに不思議な男と偶然会った。

He happened to run into a strange man while taking a walk.

退屈しているときに、紙に落書きをしたことがありませんか?

Have you ever doodled on paper when you were bored?