惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
Engineering at Meta
Engineering at Meta
I
InfoQ
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
S
SegmentFault 最新的问题
H
Help Net Security
博客园 - 【当耐特】
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
腾讯CDC
雷峰网
雷峰网
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
D
Docker

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - NTICompass/NetworkAttachedMouse: A serial mouse ...
nticompass · 2026-06-25 · via Hacker News: Show HN

Network Attached Mouse

A serial mouse driver capable of connecting to a serial mouse over the network via a terminal server (and I guess a local COM port too, but where's the fun in that?).

TL;DR: A python script to connect to a network port (or COM port) and let you use a serial mouse on Windows1.

NetMouse.exe --microsoft --ip=192.168.1.2 --port=3008
# or
NetMouse.exe --microsoft --com=COM7
# or
uv sync
uv run main.py --microsoft --ip=192.168.1.2 --port=3008

Serial mouse attached to a terminal server (Note: Click picture for video demo)

Backstory

At a swap meet, I'd picked up a terminal server, specifically a Lantronix ETS8P. A terminal server is a device with multiple serial/RS-232 ports that lets you access those ports over the network.

You configure the baud rate and other serial settings on the device - via telnet or by accessing it over a serial console/terminal - and then you can access each of its serial ports through a network port. In my case ports 3001 - 3008.

Anyway, I was using to access my home server by its serial console when I was curious about something. Does it only work with serial consoles? Or could I connect any serial device and access that over the network?

Initial tests

I wanted to try this, but I wasn't really sure where to start. First, I'd need to find/create a serial mouse driver, I guess...

I didn't really want to create my own driver, as I'm sure someone must've created this already. After plenty of searching, I found the inputattach command for Linux (part of the linuxconsoletools package on Fedora).

Let's see if my mouse even works at all, so I used my trusty USB to serial adapter and ran

sudo inputattach --microsoft /dev/ttyUSB0

and it just worked! I'm using a KeyTronic branded 2-button mouse, but lots of mice used the "Microsoft Serial Mouse" command set.

Ok, this bodes well for it working over the terminal server, so let's configure that. According to inputattach.c, the mouse communicates at 1200 baud, 7N1. I configured port 8 on my terminal server, and connected the mouse2 and a null-modem adapter. I then set the termianl server's IP and used one of my favorite linux tools, socat.

socat -d -d pty,rawer,echo=0,link=/tmp/sermouse tcp:192.168.1.2:8008
sudo inputattach --microsoft /tmp/sermouse

This got me... a permission error! Not sure why, but inputattach can't attach to symlinks - which is what /tmp/sermouse is. But, if you look at the symlink it goes to /dev/pts/2 and using that...

socat -d -d pty,rawer,echo=0,link=/tmp/sermouse tcp:192.168.1.2:3008
sudo inputattach --microsoft /dev/pts/2

worked! Now I could move my serial mouse, connected to the terminal server, wait a bit and see the cursor move on my screen!

What about Windows?

inputattach is very much a Linux tool, so what about Windows. Well, it turns out that Windows 11 still has a serial mouse driver built-in! You can enable it like this:

sc config sermouse start=demand

after running this, nothing seems to have happened. Even with my USB to serial adapter and mouse connected.

After a reboot, however... the mouse just started working! Device manager even showed "Microsoft Serial Mouse". Cool, that's awesome, now to connect to a network port.

I think there is socat for Windows, and I even found something like com0com to create a virtual COM port, but I couldn't figure out how to attach it to the sermouse driver. Just like on Windows 9x, the Windows 11 sermouse scans the COM ports for mice on boot up. There's no way to manually enable it on a arbitrary COM port, at least I couldn't figure out how.

So, I gave in and decided to make my own driver for the mouse.

Serial mouse decoder

Fine, I'll make my own decoder3. I just need to understand what the (binary) I'm getting from the mouse means and how to decode it. Good thing I found some helpful info about that from searching the web!

Links:

This doesn't seem too complicated. The mouse sends 3-byte packets, which each bit having a specific meaning - including that meaning being "unused". So, just grab bytes as they come in, and after every 3, decode that packet.

While I could just start totally from scratch, using only the description of how the packets work, I could also adapt code that's already been written. So, thanks to @reconbot (also https://roborooter.com/post/serial-mouse-project/) for doing the hard work for me!

Basing my code off of his (https://github.com/reconbot/serial-mouse-parser/blob/master/lib/stream.ts), and using pynput (so I don't need to call win32 APIs manually), I got to work and was able to make a basic mouse driver that reads/decodes the packets from the mouse and moves the cursor on the screen.

Video Demo

NetMouse_Demo.mp4
  1. Should also work on MacOS and Linux, but I only tested it on Windows. ↩

  2. This terminal server only has RJ-45 ports, according to the docs the pinout matches that of a Cisco console/rollover cable. I do have one of those, but I used a generic RJ-45 to DB-25 adapter to make my own. ↩

  3. I am a professional PHP and JavaScript (TypeScript) developer and I am still learning python and currently only use it for fun/hobbies. ↩