How jameslockman/griffin-powermate-driver works
PowerMate Agent turns physical knob and button input into scroll, audio, keystroke, and configured press actions, with menu-bar configuration and automatic per-app overrides. The graph includes the HID driver, settings/UI, audio and LED capabilities, and status presentation. Some helper implementations were indexed or read but their call sites were not shown; those links are omitted rather than inferred.
Main entry points: main.swift Agent runtime · PowerMateDriver.swift HID driver · Menu.swift Menu controls · AudioControl.swift Audio control
Components 22
Device Input
- HID driver
Sources/PowerMateDriver/PowerMateDriver.swift - Button and rotation events
Sources/PowerMateDriver/PowerMateDriver.swift - Driver demo
Sources/PowerMateDemo/main.swift
Agent Behavior
- Agent runtime
Sources/PowerMateAgent/main.swift - Keypress mode
Sources/PowerMateAgent/KeypressMode.swift - Input event posting
Sources/PowerMateAgent/EventPosting.swift - Script actions
Sources/PowerMateAgent/ScriptSupport.swift - Audio control
Sources/PowerMateAgent/AudioControl.swift - App lifecycle
Sources/PowerMateAgent/AppDelegate.swift - Update check
Sources/PowerMateAgent/UpdateCheck.swift - Self-test
Sources/PowerMateAgent/SelfTest.swift
Configuration
- Settings and actions
Sources/PowerMateAgent/Settings.swift - Menu controls
Sources/PowerMateAgent/Menu.swift - Per-app settings UI
Sources/PowerMateAgent/AppOverridesWindow.swift - Per-app overrides
Sources/PowerMateAgent/AppOverrides.swift
System Feedback
- System volume API
Sources/CAudioVolume/CAudioVolume.c - Audio VU meter
Sources/PowerMateAgent/AudioMeter.swift - LED control
Sources/PowerMateAgent/LEDControl.swift - USB LED requests
Sources/CPowerMateLED/PowerMateLEDControl.c - Menu and Dock icons
Sources/PowerMateAgent/StatusIcon.swift
Other components
- Mac user
- PowerMate
Connections 22
- Mac user → PowerMate: turns or presses
README.md - PowerMate → HID driver: sends HID reports
Sources/PowerMateDriver/PowerMateDriver.swift - HID driver → Button and rotation events: decodes reports
Sources/PowerMateDriver/PowerMateDriver.swift - Agent runtime → HID driver: starts driver
Sources/PowerMateAgent/main.swift - Button and rotation events → Agent runtime: invokes callbacks
Sources/PowerMateDriver/PowerMateDriver.swift - Mac user → Menu controls: configures behavior
README.md - Menu controls → Settings and actions: saves defaults
Sources/PowerMateAgent/Menu.swift - Mac user → Per-app settings UI: sets app options
README.md - Per-app settings UI → Per-app overrides: edits overrides
Sources/PowerMateAgent/AppOverridesWindow.swift - Agent runtime → Settings and actions: reads active settings
Sources/PowerMateAgent/main.swift - Agent runtime → App lifecycle: creates delegate
Sources/PowerMateAgent/main.swift - Agent runtime → Input event posting: posts input actions
- Agent runtime → Keypress mode: handles keypress mode
- Agent runtime → Audio control: adjusts volume
- Audio control → System volume API: sets system volume
- Agent runtime → Audio VU meter: drives VU display
- Agent runtime → LED control: updates device LED
- LED control → USB LED requests: sends LED requests
- Agent runtime → Script actions: runs configured scripts
- Menu controls → Menu and Dock icons: reflects mode state
- HID driver → Driver demo: used by demo
Sources/PowerMateDemo/main.swift - Mac user → Menu and Dock icons: views status
README.md