The first time I saw trackpad in an apple store, I was deeply attracted by its design. I thought about the features, touch, and wireless connectivity that mobile phones share with it, so it can act as this role.
Later, I found many such programs on the Internet. So I put it on hold and didn't implement it.
However, I recently thought of this thing, and it was really interesting. I realized it in my spare time and made it open-source for the reference of interested friends.
Currently, I have implemented two mobile client versions: Android and iPhone, and Windows and Mac.
Implementation ideas:
- Interconnection. The computer sends a broadcast on the LAN and enables the TCP Service. After receiving the broadcast address, the mobile phone establishes a TCP connection with the computer.
- Data. The mobile client simulates the three mouse keys and a touchpad. After obtaining the touch data, it passes it to the computer.
- Control. Obtain data from the computer, perform simple parsing, and then use the functions provided by the system for control. Windows uses sendinput or mouse_event, while Mac can use cgeventcreatemouseevent to simulate mouse and scroll wheel events.
Each version of the source code is on my GitHub: https://github.com/zhijie/trackpad
Only basic functions, network exceptions, and multiple connections are implemented. Uidesign is not yet performed. I will update it in time :)