I forgot to get my keys when I was leaving my apartment.
I forgot to get my keys leaving my apartment.
Leaving my apartment, I forgot to get my keys.
I'm curious about the ing-verb forms and how they're used. I see people dropping out When I was/ while I was.. all the time, like when constructing sentences like "I was walking the streets talking over the phone with my friend.." where we're talking about doing two, or more than two things at the same time.
The two sentences in the second example (the one with the or) probably don't mean the same as the first one, and is probably grammatically incorrect.