2

I've read multiple posts on how TeamViewer establishes a connection to the computer, but none of them seem to explain how it actually moves the cursor on the screen or clicks.

What commands is it running on my computer? Can I run those commands on my own without TeamViewer?

Pro Q
  • 389
  • 1
  • 3
  • 19
  • Note that there's a difference between sending commands _to_ the computer and performing the actions _on_ the computer. The former would be the network protocol, of which there are many, and none of them are somehow magic. It's the latter (SetCursorPos and such) that is actually useful and common between all remote-desktop tools. – u1686_grawity Aug 12 '16 at 07:23
  • @grawity thanks for the clarification. I'll update my question. – Pro Q Aug 12 '16 at 17:55

1 Answers1

3

All Windows programs can set the position of the mouse cursor with the SetCursorPos function.

Mouse clicks are one of the things that can be simulated with the SendInput function. Specifically, the dwFlags field of the MOUSEINPUT structure can specify a "mouse up" or "mouse down" action for any mouse button.

Ben N
  • 40,045
  • 17
  • 140
  • 181
  • Is there anything similar to this for Macs or Chromebooks (Linux)? – Pro Q Mar 07 '17 at 18:05
  • 1
    @ProQ I'm afraid I'm not very familiar with those environments, but [this approach](http://stackoverflow.com/q/10255995/2825369) looks promising for OSX. – Ben N Mar 07 '17 at 18:06