How dokiriii/pc_contoller works
This repository pairs a Flutter client (its Dart application sources are not present in the supplied tree) with a Python remote-input server. The visible server workflow accepts TCP commands with responses and UDP commands without acknowledgements, parses JSON, routes by command type, and executes keyboard, text, mouse, or system actions. Server startup coordinates both transports; platform-native mouse input is abstracted for Linux and Windows. Client-to-server product behavior is evident only from server-side protocol comments, so client runtime links are not inferred.
Main entry points: command_handler.py Command handlers · server.py Server lifecycle · tcp_worker.py TCP worker · udp_worker.py UDP worker
Components 23
Server transport
- Server entry
server/main.py - Server lifecycle
server/server/server.py - TCP connection
server/server/tcp_connection.py - TCP worker
server/server/tcp_worker.py - UDP connection
server/server/udp_connection.py - UDP worker
server/server/udp_worker.py
Command processing
- JSON protocol
server/server/protocol.py - Command router
server/server/router.py - Command handlers
server/core/command_handler.py - Command result
server/core/command_result.py
Input execution
- Keyboard actions
server/commands/keyboard.py - Text actions
server/commands/text.py - Mouse actions
server/commands/mouse.py - Mouse platform API
server/input/mouse_input.py - Linux mouse input
server/input/mouse_input_linux.py - Windows mouse input
server/input/mouse_input_windows.py - System commands
server/commands/system.py
Flutter client shells
- Flutter client
- Linux app shell
client/linux/runner/my_application.cc - Windows app shell
client/windows/runner/main.cpp - macOS app shell
client/macos/Runner/AppDelegate.swift - iOS app shell
client/ios/Runner/AppDelegate.swift
Other components
- Remote user
Connections 27
- Remote user → Flutter client: uses
- Server entry → Server lifecycle: starts
server/main.py - Server lifecycle → TCP connection: creates
server/server/server.py - Server lifecycle → UDP connection: starts
server/server/server.py - Server lifecycle → TCP worker: dispatches
server/server/server.py - Server lifecycle → UDP worker: starts
server/server/server.py - TCP worker → TCP connection: receives commands
server/server/tcp_worker.py - TCP worker → JSON protocol: parses
server/server/tcp_worker.py - TCP worker → Command router: routes
server/server/tcp_worker.py - TCP worker → TCP connection: sends response
server/server/tcp_worker.py - UDP worker → UDP connection: receives packets
server/server/udp_worker.py - UDP worker → JSON protocol: parses
server/server/udp_worker.py - UDP worker → Command router: routes
server/server/udp_worker.py - Command router → Command handlers: dispatches
server/server/router.py - Command handlers → Keyboard actions: dispatches
server/core/command_handler.py - Command handlers → Text actions: dispatches
server/core/command_handler.py - Command handlers → Mouse actions: dispatches
server/core/command_handler.py - Command handlers → System commands: dispatches
server/core/command_handler.py - Command handlers → Command result: returns
server/core/command_handler.py - Command router → Command result: returns
server/server/router.py - Mouse actions → Mouse platform API: calls
server/commands/mouse.py - Mouse platform API → Linux mouse input: selects platform
server/input/mouse_input.py - Mouse platform API → Windows mouse input: selects platform
server/input/mouse_input.py - Linux app shell → Flutter client: hosts
- Windows app shell → Flutter client: hosts
- macOS app shell → Flutter client: hosts
- iOS app shell → Flutter client: hosts