I read this in Wikipedia: “The program becomes modal, switching between interpreting commands from the keyboard or passing keystrokes on as data to be processed.”
The word interpreting makes me confused. If it is an adjective, then it has an active form. But then there is a mismatch – the commands are interpreted. But it sounds like they are interpreting something.
It can also be a gerund with its own object. For example: Smoking cigarettes is bad for you. How can we distinguish between these two cases?
It is indeed a gerund here. But, as you say, it could have been a participle/adjective in this case, except that the meaning clearly shows that it must be a gerund.
So this may cause ambiguity in cases where the meaning isn’t entirely clear. Writers should be aware of this possible ambiguity and avoid it by recasting ambiguous sentences.