Skip to content

PyShot 2.0.0

Choose a tag to compare

@U-C4N U-C4N released this 28 Jul 19:43
· 9 commits to main since this release

Press Ctrl+Shift+H anywhere: the screen freezes and dims, you drag a region (or click a window), and you get a lossless PNG on your Desktop and on the clipboard. One Python file, fully offline, no telemetry, no global keyboard hook.

New

  • Capture follows the mouse. The overlay opens on the monitor you are actually working on, not always the primary one — CAPTURE_TARGET = "cursor" | "primary" | "all".
  • Click a window to capture it, at its true DWM frame: no border slivers, no drop shadow.
  • Magnifier with crosshair guides and a live x,y #rrggbb readout. C copies that colour instead of taking a shot.
  • Your hotkey actually rebinds. HOTKEY_CAPTURE = "printscreen" (or "ctrl+alt+f9", "ctrl+shift+f12", …) now works; previously those constants were labels that did nothing and the real binding was a hex virtual-key code.
  • CAPTURE_MODE picks the sinks: both, clipboard (nothing accumulates on your Desktop), or file.
  • The toast is clickable — open the shot, or right-click to reveal it in Explorer — and it honours the taskbar's real work area on any edge.
  • Failures are visible. A missing dependency, a hotkey another app already owns, and a second launch each say so on screen instead of failing silently under pythonw.
  • Tests and CI. pytest covers the pure logic (crop math, filename sequencing, the CF_DIB header, hotkey parsing), CI runs on windows-latest, plus requirements.txt, a pinned ruff config, and pyshot.spec for a single-file PyShot.exe.

Fixed

  • A save error no longer throws the capture away — the clipboard write needs no filesystem, so a read-only, full or offline OneDrive Screenshots folder can't cost you the shot.
  • A replaced toast no longer leaves an armed timer behind, which surfaced as a modal Tcl error dialog in a tool whose whole premise is being silent. The selection renderer had the same latent flaw.
  • Alt+F4 on the overlay no longer wedges PyShot into ignoring every later hotkey, and nothing escaping the event loop can stop it re-arming.
  • The desktop and taskbar are excluded from window snapping, so a click on empty space cancels instead of saving a full-screen PNG.
  • Esc registration, --startup reporting, explorer /select on paths containing spaces, and the startup shortcut's self-repair all behave as documented.

Changed

  • The capture target defaults to the monitor under the cursor rather than always the primary one.
  • A click without a drag grabs the window under it; previously it always cancelled.
  • --debug is now --startup (the old name still works), --help exists, and an unknown option is reported instead of silently starting an invisible background copy.

Install

pip install -r requirements.txt
pythonw pyshot.py            # runs in the background, no console window
python pyshot.py --startup   # add to / remove from Windows startup

No Python? Build a single self-contained executable:

pip install pyinstaller
pyinstaller pyshot.spec      # → dist\PyShot.exe

Requires Windows 8.1+ (best on Windows 10 1703+) and Python 3.9+.