Assume non-touch device if no real device associated with event to prevent on-screen keyboard from engaging.
I have two desktops with two monitors each: setup image. The keyboard/mouse there are physically attached to the vertical monitors, and another desktop controls the horizontal monitors on the left. I use Synergy to share the keyboard/mouse across them all.
Through synergy the on-screen keyboard appears any time I click on an area with possible input, even with the OSK turned off in Settings. Here's a video illustrating this. If I use the mouse/keyboard physically attached to those monitors this doesn't happen.
Here's my xinput out
If I touch the bottom left monitor (a touch screen) gnome switches into showing the OSK constantly until I move the physical mouse again. After that I can use Synergy too without the OSK appearing.