Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Don't type into a window someone is using: a cross-platform idle gate in Node.js

Description and use

Relaymote now verifies the user has been idle for a specified time before performing UI actions, preventing keystroke interference.

Problem

A remote tool may send keystrokes to a window while a user is typing, causing interleaved input.

Outcome

By treating unknown or stale idle readings as busy, Relaymote avoids typing into a window while the user is active, ensuring safe UI automation.

Workflow

  • 1. Relaymote calls isIdle(minMs) before any UI action.
  • 2. isIdle calls idleMs() to obtain current idle time.
  • 3. idleMs() starts the idle sampler if not already running.
  • 4. idleMs() checks if the last reading is stale; if so, returns null.
  • 5. idleMs() returns the last idle time plus elapsed age if fresh.
  • 6. isIdle returns true only if the idle time is not null and >= minMs; otherwise false.
  • 7. If isIdle returns false, Relaymote blocks the UI action; if true, it proceeds.

Evidence

True only when the user has provably been away for minMs. Unknown is NOT idle.

Source

When you cannot tell whether the user is at the keyboard, the safe answer is "not idle" — never "idle".

Source

A cached reading is only trustworthy for a moment. If the PowerShell sampler dies, or the macOS probe stops answering, the last number keeps aging.

Source

  • Record date: 2026-10-21T07:56:27.408Z