I want to know what is the form for "when" in a phrase like "I was reading a book, when someone knocked on my door." I'm aware of the usage of "toki" in phrases like "When I was a teacher..." and "When I talk to someone, they run away...," but I'm not sure if I can use "toki" for "when" in the phrase I want to write ( I was reading a book, when someone knocked on my door and I had to stop reading the book ) . For example, I'm not sure if this phrase with "toki" does that.
"私は本を読んでいたとき、彼が何か話した"
Because it looks like it means "When I was reading a book, he said something" which isn't quite what I want to reach.
"I was reading a book, when he said something" < - Is what I want to know how to write
"When I was reading a book, he said something" ! < - There is a difference