Funny you mention that when literally all flagship phones (both iOS and Android) have a "Do you trust this computer?" popup that does exactly what you described. By default, phones don't do any data transfer over USB.
This whole thread is bizarre. A whole lot of fretting over an attack that nobody bothered to describe.
Which keystrokes are you talking about and on which OS does that attack work? I can't think of anything that would work on my iPhone.