Introduction
Want to make your recordings more dynamic and engaging? Check out the video below to see the zoom-to-mouse effect in action
While paid tools like Screen Studio offer this capability, what if you could achieve the same effect for free? The good news is that you can, using OBS Studio!
In this guide, I’ll walk you through the steps to set up zoom-to-mouse functionality. These instructions have been tested on Windows and Mac, and the process should be quite similar for Linux users.
1. Download the Magical Script
To get started, you’ll need to download the script that enables the zoom-to-mouse functionality in OBS Studio
- Open this link.
- In the Assets section, click to download the
obs-zoom-to-mouse.lua
file.

2. Set Up Your OBS Screen
Now that you have the script, let’s set up your OBS scene:
- Launch OBS.
- Add a New Scene by clicking the + button under the Scenes section.
- Next, add a New Source:
- On Mac, select
macOS Screen Capture
as the source. - On Windows, choose
Display Capture
as the source.
- On Mac, select
Important: Not all sources work with this script, so ensure you pick the right one.

3. Setup the zoom to mouse script
Now let’s connect the script to your scene:
- Click Tools in the top menu bar.
- Select Scripts from the dropdown.
- In the Scripts tab, click the plus icon (+) to add the
obs-zoom-to-mouse.lua
script. - On the right side, you’ll see configuration options. Choose the Zoom Source you created earlier (if you can’t find it, click Refresh zoom sources).
You can adjust the configuration to your liking, but to match the result from my video, here’s the setup:

Tip for Mac Retina Displays: If you’re on a Mac with a retina display, you might experience some weird behavior with zoom-to-mouse. To fix this, check the option for Set Manual Source Position and refer to the issue discussion for more details.
For a smoother experience on Retina displays, you can adjust the Scale X
and Scale Y
to 2
, and make sure to set the Monitor Width
and Monitor Height
based on your screen resolution. Here’s my configuration for reference:

4. Setup OBS Hotkey
To control the zoom-to-mouse functionality, you’ll need to configure some hotkeys:
- Go to Settings in OBS.
- Navigate to the Hotkeys section in the left sidebar.
- Search for Toggle zoom to mouse and Toggle follow mouse during zoom.
- Assign your preferred hotkeys (I recommend
1
and2
for easy access).

Setup Global Hotkeys (Mac Only)
For now the hotkeys are only active when OBS is in focus. If you want to use the hotkeys while working in other applications, you need to set up global hotkeys:
-
Enable Accessibility Permissions
- Open System Settings.
- Navigate to Privacy & Security in the sidebar.
- Click on Accessibility.
- Add OBS to the list of apps that can control your computer.
- Toggle the switch to enable the app.
-
Allow Input Monitoring
- Back in the Privacy & Security tab, select Input Monitoring.
- Add OBS to the list of apps that can monitor input.
- Toggle the switch to enable the app.
Please note: There is a known issue where this configuration may only work for a few hours. If you encounter this, try restarting your computer to restore functionality. You can read more about this issue here.
And That’s It!
Now you’re ready to use the zoom-to-mouse functionality in OBS Studio. Simply press ‘1’ to zoom in and out, and ‘2’ to toggle the zoom following your mouse. This feature can help make your tutorials, presentations, or streams more engaging.
Last updated on January 3, 2025 at 8:07 PM UTC+7. See Changelog