OBS Studio Keystroke Overlay Lua Script Guide
Learn how to display your real-time keyboard inputs directly on your stream or recording using OBS Studio. This guide walks you through the process of setting up a custom Lua script, linking it to an OBS text source, and customizing the keystroke history overlay for a clean, professional presentation.
Step 1: Prepare Your Lua Script
To display keystrokes, you need a custom Lua script (typically a
.lua file) designed to log system inputs and output them to
OBS. Ensure you have the script file downloaded and saved in a dedicated
folder on your computer where it will not be accidentally deleted.
Step 2: Create a Text Source in OBS
The Lua script requires an active text source in OBS Studio to display the captured keystrokes.
- Open OBS Studio.
- In the Sources dock, click the + (Add) button.
- Select Text (GDI+) from the list.
- Name the source (e.g., “Keystroke Display”) and click OK.
- Leave the text field empty and click OK to save the source.
Step 3: Load the Lua Script into OBS
- In the top menu bar of OBS Studio, click on Tools and select Scripts.
- In the Scripts window, make sure you are on the Loaded Scripts tab.
- Click the + (Add) button in the bottom-left corner.
- Navigate to the folder where you saved your custom
.luascript, select it, and click Open.
Step 4: Configure the Script Settings
Once the script is loaded, you must link it to the text source you created.
- Click on the loaded script name in the Loaded Scripts list to highlight it.
- Look at the right pane of the Scripts window to view the script’s settings.
- Locate the dropdown menu (usually labeled Text Source) and select the “Keystroke Display” source you created in Step 2.
- Adjust any custom settings provided by your specific script, such
as:
- Keystroke History Limit: The number of characters or words displayed on screen at once.
- Fade Time: How long keys remain on screen before disappearing.
- Layout Style: Horizontal or vertical display of input history.
- Click Close when finished.
Step 5: Format and Position the Overlay
Now that the script is actively sending key data to your text source, you can customize how it looks on your stream.
- Select the “Keystroke Display” source in your Sources list.
- Right-click the source and select Properties to change the font, color, outline, or gradient settings.
- In the OBS preview window, click and drag the red bounding box around the text source to resize it and position it where you want your viewers to see it.