# The-Fat-Controller-master **Repository Path**: learner_f/the-fat-controller-master ## Basic Information - **Project Name**: The-Fat-Controller-master - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-17 - **Last Updated**: 2026-05-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README <<<<<<< HEAD # The Fat Controller [![Crates.io](https://img.shields.io/crates/v/tfc)](https://crates.io/crates/tfc) [![Docs.rs](https://docs.rs/tfc/badge.svg)](https://docs.rs/tfc) ![License](https://img.shields.io/crates/l/tfc) TFC is a library for simulating mouse and keyboard events. This library was built for use by [TFC-server](https://crates.io/crates/tfc-server), a server that allows for remote control of a PC via a mobile app. ## Features - Mouse clicks - Mouse motion (relative and absolute) - Mouse scrolling (smooth scrolling where supported) - Key presses - Translating Unicode characters to key presses - Typing arbitrary Unicode strings - Getting the mouse position - Getting the size of the screen ## Platforms - Linux - With X11 - Linux - Without X11 - macOS - Windows ## Usage Add the following to your `Cargo.toml`: ```toml [dependencies] tfc = "0.6" ``` ## Linux There are two implementations for Linux, one that uses X11, and one that depends only on the Linux kernel. The implementation that doesn't use X11 is missing some features. It is intended for Wayland but Wayland is a bit more locked down compared to X11, hence the missing features. ### With X11 Before using the X11 implementation, the X11, XTest and xkbcommon development libraries need to be installed. Using `apt`, the following snippet can be used. ```shell sudo apt install libx11-dev libxtst-dev libxkbcommon-dev ``` ### Without X11 The non-X11 implementation (called Wayland within the code base) uses `/dev/uinput`. Before this can be used, TFC needs permission to write to the device. To grant permissions temporarily (until the next reboot), use the following snippet. ```shell chmod +0666 /dev/uinput ``` To grant permissions permanently, use the following snippet. ```shell # Create a group sudo groupadd -r uinput # Add yourself to the group sudo usermod -aG uinput $USER # Give the group permissions to use the uinput kernel module echo 'KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"' \ | sudo tee /etc/udev/rules.d/60-tfc.rules ``` Use the following snippet if this doesn't take effect immediately. If all else fails, reboot. ```shell udevadm control --reload-rules && udevadm trigger ``` To revoke permissions, use the following snippet. ```shell sudo rm /etc/udev/rules.d/60-tfc.rules ``` ## Example ```rust use tfc::{Context, Error, traits::*}; use std::{f64::consts::PI, thread, time::Duration}; fn main() -> Result<(), Error> { let radius = 100.0; let steps = 200; let revolutions = 3; let delay = Duration::from_millis(10); let mut ctx = Context::new()?; let center = ctx.cursor_location()?; let center = (center.0 as f64 - radius, center.1 as f64); for step in 0..steps * revolutions { thread::sleep(delay); let angle = step as f64 * 2.0 * PI / steps as f64; let x = (center.0 + radius * angle.cos()).round() as i32; let y = (center.1 + radius * angle.sin()).round() as i32; ctx.mouse_move_abs(x, y)?; } Ok(()) } ``` ======= # The-Fat-Controller-master #### 介绍 The-Fat-Controller-master #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. xxxx 2. xxxx 3. xxxx #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) >>>>>>> 5748172044d81f0ce28264b6856885fd7bb76bc2