A lightweight Windows desktop application that captures global keyboard input and displays a virtual keyboard overlay via HTTP server, designed for OBS Browser Source integration.
- Global keyboard & mouse hook capturing all input
- Virtual keyboard UI with real-time highlighting
- HTTP server (default port 9876) for OBS Browser Source
- Multiple keyboard layout support (JSON-based)
- Key statistics (KPS, total presses)
- System tray icon with layout switching
- Background execution (no visible window)
- Mouse button support (left, right, middle, X1, X2)
- Preview tool for testing layouts
- Run
key-statics.exe - Open OBS Studio
- Add a new "Browser Source"
- Set URL to:
http://localhost:9876/ - Set width: 1000, height: 300 (or adjust as needed)
- Check "Shutdown source when not visible" to save resources
The keyboard overlay will display key presses in real-time.
- 104keys.json - Full-size 104-key keyboard
- dfjk.json - Minimal DFJK layout (4 keys)
- dfjk-mouse.json - DFJK layout with mouse buttons
- wasd.json - WASD layout (4 keys)
- wasd-mouse.json - WASD layout with mouse buttons
Right-click the system tray icon to switch between available layouts.
Create a config.json file in the same directory as key-statics.exe:
{
"server": {
"port": 9876,
"autoPortIfOccupied": true
},
"display": {
"unitWidth": 40,
"unitHeight": 40,
"keySpacing": 4,
"backgroundColor": "#282828",
"keyColor": "#444444",
"keyActiveColor": "#0096FF",
"fontFamily": "monospace"
},
"layout": {
"default": "104keys"
}
}| Section | Field | Description |
|---|---|---|
| server | port | HTTP server port (default: 9876) |
| server | autoPortIfOccupied | Auto-select port if occupied |
| display | unitWidth | Key width in pixels |
| display | unitHeight | Key height in pixels |
| display | keySpacing | Gap between keys in pixels |
| display | backgroundColor | Background color (hex) |
| display | keyColor | Key background color (hex) |
| display | keyActiveColor | Key active/pressed color (hex) |
| display | fontFamily | Font family for key labels |
| layout | default | Default layout filename |
The application supports mouse button input. Add mouse keys to your layout:
{
"keys": [
{"vkCode": 1, "label": "L", "row": 0, "col": 0},
{"vkCode": 2, "label": "R", "row": 0, "col": 1},
{"vkCode": 4, "label": "M", "row": 0, "col": 2}
]
}| Key | Code |
|---|---|
| Left Button | 1 |
| Right Button | 2 |
| Middle Button | 4 |
| X1 | 5 |
| X2 | 6 |
You can create your own keyboard layout configuration.
Create a JSON file in the layouts/ folder:
{
"name": "Custom Layout Name",
"unitWidth": 40,
"unitHeight": 40,
"keySpacing": 4,
"keys": [
{"vkCode": 68, "label": "D", "row": 0, "col": 0, "width": 1},
{"vkCode": 70, "label": "F", "row": 0, "col": 1, "width": 1},
{"vkCode": 74, "label": "J", "row": 0, "col": 2, "width": 1},
{"vkCode": 75, "label": "K", "row": 0, "col": 3, "width": 1}
]
}| Field | Description |
|---|---|
name |
Display name for the layout |
unitWidth |
Width of a single key unit in pixels |
unitHeight |
Height of a single key unit in pixels |
keySpacing |
Gap between keys in pixels |
keys |
Array of key definitions |
| Field | Description |
|---|---|
vkCode |
Windows virtual key code |
label |
Text to display on the key |
row |
Row position (0-indexed, supports decimals like 1.5) |
col |
Column position (0-indexed, supports decimals) |
width |
Key width in units (default: 1) |
height |
Key height in units (default: 1) |
| Key | Code | Key | Code |
|---|---|---|---|
| A-Z | 65-90 | F1-F12 | 112-123 |
| 0-9 | 48-57 | Esc | 27 |
| Space | 32 | Enter | 13 |
| Shift | 160/161 | Ctrl | 162/163 |
| Alt | 164/165 | Tab | 9 |
- Place your JSON file in the
layouts/folder next to the executable - Restart the application
- Select your custom layout from the system tray menu
| Endpoint | Description |
|---|---|
/ |
Main HTML page with keyboard overlay |
/events |
Server-Sent Events stream for real-time key updates |
Right-click the system tray icon to access:
- Switch Layout - Choose from available layouts (current marked with *)
- Current - Shows currently active layout
- Reset Stats - Reset key press counters
- Show/Hide Keyboard - Toggle overlay window visibility
- Preview Layout - Open layout preview tool
- About - Application info
- Exit - Exit application
The preview tool allows you to test layouts without running the main OBS integration:
- Click Preview Layout from the system tray menu
- A separate window will open showing the keyboard
- Your key presses will be highlighted in real-time
- Use the dropdown to switch between different layouts
- Click Reset to clear pressed key states
This is useful for verifying your custom layout bindings before using them in OBS.
- Qt 6.x (with MinGW compiler)
- CMake 3.16+
mkdir build && cd build
cmake .. -G "MinGW Makefiles"
mingw32-makeCopy the following to your deployment folder:
key-statics.exe- All
Qt6*.dllfiles platforms/folder (Qt platform plugins)layouts/folder (keyboard configurations)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
- Qt Framework - Cross-platform UI framework (GPL)
- Krita - Digital painting application used for icon design
- Windows Hook API for global keyboard capture
This project does not accept Issues or Pull Requests.
If you would like to modify or extend this project, please fork the repository and make your own changes.
For OBS streaming, consider adjusting the browser source FPS to 60 for smoother key animations.
