Skip to content

About

An OBS lua script to zoom a display-capture source to focus on the mouse for OBS 32+

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

48 Commits

Folders and files

Repository files navigation

Zoom to Mouse Logo

OBS Zoom to Mouse

A powerful, ultra-smooth OBS Lua script that dynamically zooms your display capture and precisely follows your mouse cursor.

OBS Studio Platforms Lua License


✨ Modernized & Updated: This is an enhanced fork optimized and updated for the latest OBS Studio versions by Timexo, originally built by BlankSourceCode.


📽️ Preview

Usage Demo


⚡ Key Features

Feature Description
🚀 Ultra-Smooth Zoom Fluid, animated zoom transitions directly focused on your current mouse position.
🎯 Smart Mouse Tracking Automatically tracks your cursor with configurable deadzones, follow speeds, and boundary locks.
🛠️ Highly Configurable Full control over zoom factors, animation speeds, tracking borders, and custom source bounds.
🌐 Multi-Platform Fully compatible across Windows, Linux, and macOS.
🖥️ Dual Machine Support Integrates with remote clients via UDP sockets for secondary machine setup.

📦 Installation

  1. Download or clone this repository (make sure you have ZoomToMouse.Vx.x.x.lua).
  2. Launch OBS Studio.
  3. Add a Display Capture source to your scene (recommended for automatic positioning).
  4. Go to Tools -> Scripts in OBS.
  5. Click the + button and select the script file (ZoomToMouse.Vx.x.x.lua).
  6. In the script settings, choose your Zoom Source (e.g. your Display Capture).
  7. Set up your hotkeys (see below). Without this step, no key will zoom.

⌨️ Hotkeys / Shortcuts

There are no default hotkeys. You choose the keys yourself:

  1. In OBS, open File -> Settings -> Hotkeys (macOS: OBS -> Settings -> Hotkeys).
  2. Type zoom into the filter box at the top.
  3. Click the field next to an action and press the key or key combination you want.
  4. Click Apply, then OK.
Hotkey name in OBS What it does
Toggle zoom to mouse Zooms in to your mouse using Zoom Factor (default 2x). Press again to zoom out.
Zoom to Level 1 Zooms to Level 1 (default 1.5x). Press again to zoom out.
Zoom to Level 2 Zooms to Level 2 (default 2x). Press again to zoom out.
Zoom to Level 3 Zooms to Level 3 (default 3x). Press again to zoom out.
Cycle zoom level (1 -> 2 -> 3 -> off) Each press goes one step further, then zooms out.
Freeze/unfreeze zoom view While zoomed in, pauses or resumes mouse tracking.

💡 Just getting started? You only need Toggle zoom to mouse. All other hotkeys are optional.

Nothing happens when you press the key?

  • Check that a Zoom Source is selected in Tools -> Scripts.
  • Make sure that source is part of the scene you are currently showing.
  • For more details, tick Enable debug logging, click Run Setup Diagnostics and check the Script Log.

⚙️ Recommended Source Setup

For best results, configure your Display Capture source with these settings:

  • Transform:
    • Positional Alignment: Top Left
    • Bounding Box Type: Scale to inner bounds
    • Alignment in Bounding Box: Top Left
    • Crop: All zeros

⚠️ Note: If you use custom bounds or crops, the script will attempt to auto-correct them. If you change your display layout in Windows/Linux/Mac, re-add the display capture source and reload the script.


🎛️ Configuration Options

You can fine-tune every parameter directly from the OBS Scripts window:

  • Zoom Source: Choose which source to target.
  • Zoom Factor & Speed: Adjust magnification power and transition smoothness.
  • Auto Follow Mouse: Track cursor movement automatically when zoomed in.
  • Follow Border & Lock Sensitivity: Define deadzones and safe areas where the camera stands still.
  • Show All Sources: Enable targeting for window captures, browser sources, or cloned scenes (requires manual coordinate input).

📜 Credits & Acknowledgments

---

Buy Me A Coffee

About

An OBS lua script to zoom a display-capture source to focus on the mouse for OBS 32+

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages