Determining if the player is directly taking a thing (vs. "take all" or implicit taking)

Right now I’m not looking at the text of the player’s command for this, but if I do, I have a plan.