Skip to content

Deadly-Phantom/KeyboardGlowVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keyboard Glow Visualizer

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.

Features

  • 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

Requirements

  • macOS
  • SDL2 library
  • C++ compiler with C++11 support

Installation

1. Install SDL2

Using Homebrew:

brew install sdl2

2. Clone the repository

git clone https://github.com/yourusername/KeyboardGlowVisualizer.git
cd KeyboardGlowVisualizer

3. Build

make

Usage

Run the application:

./glow
  • Type while the window is focused to see the glow effects
  • Press ESC to quit

Configuration

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

How It Works

  1. Window Creation - Creates a borderless window covering the usable screen area (excludes menu bar and dock)
  2. 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
  3. Rendering - Draws four border rectangles with additive blending, allowing colors to mix when multiple glows are active
  4. Animation - Each glow's alpha decreases linearly over the fade duration until it's removed

Project Structure

KeyboardGlowVisualizer/
├── main.cpp          # Main application source
├── Makefile          # Build configuration
├── create_app.sh     # Script to create macOS .app bundle
└── README.md         # This file

Makefile Commands

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

Known Limitations

  • 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.

License

MIT License - Feel free to use and modify as you like.

Contributing

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.)

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors