AI chat

Move my mouse with the numpad, my wrist hurts

Here is a complete script that turns your numpad into a full mouse controller with smooth acceleration, diagonal movement, clicking, dragging, scrolling, and a precision key.

Layout

  • Movement: 8 (Up), 2 (Down), 4 (Left), 6 (Right), and diagonals 7, 9, 1, 3
  • Left Click & Drag: 5 (holds while pressed so you can click or drag)
  • Right Click: . (KpDot)
  • Middle Click: + (KpPlus)
  • Precision Mode: Hold 0 (Kp0) to slow cursor movement down to 25% for small targets
  • Scroll: / (KpDivide) to scroll up, * (KpMultiply) to scroll down

How it works

  1. Interception: rb.bind(key, nil) intercepts each key on the numpad and prevents numbers from being typed into other windows.
  2. Acceleration: Running at tick_rate=125 (8 ms intervals), the script tracks how long you hold a movement key and ramps up from base_speed to max_speed, giving you immediate precision on tap and rapid traversal across monitors on sustained holds.
  3. Sub-pixel accumulation: Fractions of a pixel are preserved in carry_x and carry_y between ticks so fine movements remain responsive and jitter-free even at low speeds.
  4. Safety: If the window blurs or the script stops, all mouse buttons are cleanly released.

Learn more