How does TeamViewer control my cursor?

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

Posted 2016-08-12T01:57:40.493

Reputation: 207

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. – user1686 – 2016-08-12T07:23:08.367

@grawity thanks for the clarification. I'll update my question. – Pro Q – 2016-08-12T17:55:12.880

Answers

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

Posted 2016-08-12T01:57:40.493

Reputation: 32 973

Is there anything similar to this for Macs or Chromebooks (Linux)? – Pro Q – 2017-03-07T18:05:14.383

1

@ProQ I'm afraid I'm not very familiar with those environments, but this approach looks promising for OSX.

– Ben N – 2017-03-07T18:06:46.017