javaScripts to visualize mouse position and key presses.
The examples in this repository feature the javaScript libraries P5.js and Cables.gl. Both are free and open source tools for making interactive content.
- replace mouse input with eventListeners
- add OBS WebSocket connection.
Procedural 2d fish
Follow Mouse
Zoom and Follow Mouse
The examples in this repository feature the javaScript libraries P5.js and Cables.gl. Both are free and open source tools for making interactive content.
How it works
- OBS hotkeys capture keyboard and mouse input that happens anywhere on your computer.
- Keyboard and Mouse events trigger an Advanced Scene Switcher macro that displays the event data in a Text Source.
- A Browser Source with javaScript listens for changes and renders the visualization
Required Software
OBS and the following plug-ins are required.- Advanced Scene Switcher
- Move Transition
- Source Dock
- Source Clone
- Advanced Masks
- Composite Blur
- Stroke Glow Shadow
Getting started
Download this repository
- After installing OBS and the requisite plug-ins, download this repository.
- Extract the .zip download
Turn on the OBS WebSocket Server
OBS includes a webSocket server. The webSocket server will allow the Browser Source to receive the Keyboard and Mouse event messages.- Turn on the WebSocKet Server, from the file menu select "Tools --> WebSocket Server Settings"
- check the "Enable WebSocket server" setting
- Navigate to the folder where extracted the "keyboard and mouse visuals" are saved.
- Open the file /browser_Sources/obs_webSocket_details/websocketDetails.js
- Enter the WebSocket Server Password.
- enter the password after "PW":"
- Save the change to "websocketDetails.js"
Import Scene Collection
Use the file "Key_and_Mouse_Visuals_Collection.json" to configure OBS .- In OBS, on the file menu click "Scene Collection --> Import"
- navigate to the file "Key_and_Mouse_Visuals_Collection.json", in the downloaded folder.
- Change to the imported Scene Collection. "Scene Collection --> Key_and_Mouse_Visuals_Collection"
- OBS will ask where the local webpages are located.
- click the "Search Directory..." button
- navigate to where this repo is saved on your computer.
User Interface.
The Source Dock Plug-in is used to display the Keyboard and Mouse values. Mouse Follow and Zoom controls allow switching the scene view.Create your own Visualization
The repo includes a starter template to- replace mouse input with eventListeners
- add OBS WebSocket connection.
Examples
Attribution for the examples used in this repoKey overlay
- Space Type Generator "Stripes" by Kiel Mutschelknaus
Mouse overlay
Example of mouse visualizations created with javaScript libraries.Procedural 2d fish
- P5 js soft body example
Follow and Zoom to Mouse
The Follow and Zoom to Mouse Visualizations are created using javaScript to control the OBS Plug-ins Advanced Mask and Move Transition.Follow Mouse
Zoom and Follow Mouse