をたたいて

hit/tap … and

→ を
phrase Uncommon #8,881
hit/tap … and を marks the thing being hit or tapped; たたいて connects this action to what follows.
JA: ドアをたたいて、返事を待った。
EN: I knocked on the door and waited for a reply.

男の子がドラムをたたいていた。

A boy was playing the drums.