Mouse input

Monitor mouse clicks, position and scroll.

The mouse input values are passed to a Text source.

The User creates text sources to store and display incoming position, click and scroll values.

A text source is used because changes to a text source are easily observed by WebSocket clients. When a text source is updated an "InputSettingsChanged" event is sent to webSocket clients. See the Mouse Overlay Example tutorial for a complete example.

Mouse input.excalidraw.png

Setup

Install Python dependencies

This script uses the Pynput Library.

  1. Open the Terminal app
  2. Enter the pip command
 python3.11 -m pip install pynput 

Add the Mouse Input Script to OBS

The "Mouse Input" script and accompanying OBS Collection can be found on Github.
python mouse input repo

Import the Mouse Input OBS Collection

  1. Download the Mouse input Collection
  2. In OBS, from the menu select Scene Collection > Import
  3. Import the collection
  4. Choose the collection Scene Collection

Add the Script

  1. Download the Mouse Input Script
  2. In OBS, from the menu select Tools > Scripts
  3. Click the + Add script button

Configure Text Source

Choose Source

Check the mouse inputs to monitor.

Pasted image 20251122153358.png