← All posts

Simulating Human Typing Without Faking Human Behavior

2026Python · Automation

Perfect automation often looks suspicious. That was the problem I cared about. Most typing scripts move at constant speed, never hesitate, never mistype, never revise. Humans do all of that. They pause mid-thought. They hit adjacent keys. They backspace too far. I wanted to model those imperfections instead of smoothing them away.

Building a Typing Engine That Feels Uneven

The core of Humantype is a system level typing engine built around timing variability and error simulation. Instead of fixed delays, each keystroke gets Gaussian noise. Common words can burst out faster. Longer words slow down. Punctuation creates pauses. Sometimes the script stops briefly to simulate thinking.

Mistakes were the interesting part. I mapped adjacent keys on a QWERTY layout so typos looked plausible, not random. Wrong characters get inserted, corrected, and retyped. There is also duplicate character behavior and uneven backspacing. Small details, but they change how synthetic input feels.

One technical decision that mattered was treating editing as part of typing, not as an afterthought. I built a diff based transition system that finds a common prefix, deletes divergences, and types revisions naturally. That made draft transitions feel closer to someone rewriting in real time.

Simulating Drafting, Not Just Keystrokes

The more unusual part was integrating local language models through Ollama to generate intermediate drafts. Instead of only typing final text, the script can move through rough drafts, revisions, and cleaner versions. I liked that because writing is rarely linear.

That feature started as an experiment and became one of the most interesting parts of the project. It pushed the tool beyond automation and into behavioral simulation.

What Broke and What Felt Hardcoded

A lot of it is still opinionated. The typo model assumes QWERTY. Pause behavior is hand tuned. Some Unicode handling falls back through the clipboard, which works but is not elegant. The AI drafting flow depends on a local Ollama setup and degrades when that stack is unavailable.

Cross platform support is also unfinished. The script leans heavily toward macOS because of accessibility permissions and fallback behavior. If I revisit it, portability would be the first serious rewrite.

What I Learned

The biggest lesson was that realism comes from edge cases. Not from adding more randomness. From modeling constraints. Human behavior looks messy, but much of that mess has structure.

Good automation does not always look perfect. Sometimes it should look slightly wrong.

View all projects →View on GitHub ↗