A macOS application that displays colorful glowing borders around your screen when you type. Each keypress triggers a vibrant, randomly-colored glow effect that fades smoothly over time.
- Full-screen border glow - 20px colored borders on all four sides of the usable screen area
- Random vibrant colors - Uses HSV color space to generate saturated, bright colors
- Smooth fade animation - Colors fade out over 1.5 seconds with additive blending
- Layered effects - Multiple keypresses stack with additive blending for dynamic color mixing
- Semi-transparent window - See through the center while borders remain visible
- Lightweight - Simple SDL2-based rendering with VSync support
- macOS
- SDL2 library
- C++ compiler with C++11 support
Using Homebrew:
brew install sdl2git clone https://github.com/yourusername/KeyboardGlowVisualizer.git
cd KeyboardGlowVisualizermakeRun the application:
./glow- Type while the window is focused to see the glow effects
- Press ESC to quit
You can modify these constants at the top of main.cpp:
| Constant | Default | Description |
|---|---|---|
BORDER_THICKNESS |
20 | Width of the border in pixels |
FADE_DURATION |
1500 | How long glows take to fade (milliseconds) |
To adjust window transparency, modify the opacity value in SDL_SetWindowOpacity():
SDL_SetWindowOpacity(window, 0.3f); // 0.0 = invisible, 1.0 = fully opaque- Window Creation - Creates a borderless window covering the usable screen area (excludes menu bar and dock)
- Color Generation - On each keypress, generates a random color using HSV with high saturation (0.8-1.0) and value (0.8-1.0) for vibrant results
- Rendering - Draws four border rectangles with additive blending, allowing colors to mix when multiple glows are active
- Animation - Each glow's alpha decreases linearly over the fade duration until it's removed
KeyboardGlowVisualizer/
├── main.cpp # Main application source
├── Makefile # Build configuration
├── create_app.sh # Script to create macOS .app bundle
└── README.md # This file
| Command | Description |
|---|---|
make |
Build the application |
make clean |
Remove build artifacts |
make run |
Build and run |
make rebuild |
Clean and rebuild |
make app |
Create macOS .app bundle |
- Requires focus - The window must be focused to receive keyboard input. Global keyboard monitoring requires accessibility permissions and additional macOS frameworks.
- Semi-transparent only - True transparency (fully transparent center with opaque borders) is not supported by SDL2 on macOS. The entire window shares the same opacity level.
MIT License - Feel free to use and modify as you like.
Pull requests welcome! Some ideas for improvements:
- Add command-line arguments for configuration
- Support multiple color schemes/palettes
- Add audio-reactive mode
- Implement different glow patterns (pulse, wave, etc.)