[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-77815":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":13,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":16,"lastSyncTime":26,"discoverSource":27},77815,"Griffin-PowerMate-Driver","jameslockman\u002FGriffin-PowerMate-Driver","jameslockman","A modern driver for the Griffin PowerMate",null,"Swift",126,5,3,0,1,2,10,2.33,false,"main",true,[],"2026-06-12 02:03:44","# Griffin PowerMate driver for modern MacOS\n\nThis small driver enables the Griffin PowerMate, a nifty little device from days gone by. What does the PowerMate do? It is a knob that you can twist or that you can press. That's it. It also has a blue LED in the base that can change intensity based on what you're doing.\n\nWhen it was released, it was intended to assist video and audio production by adding a scrollable knob to your desktop. Of course, modern controllers exist that offer many more literal bells and whistles, but there is something... quaint... about this early device.\n\nTo install, download the latest release from the [releases tab](https:\u002F\u002Fgithub.com\u002Fjameslockman\u002FGriffin-PowerMate-Driver\u002Freleases). Download and open the DMG, and then drag **PowerMate Agent** to your Applications folder. Then, launch **PowerMate Agent**.  Of course, it won't do anything without a PowerMate, so go dig around in your junk USB drawer and dust it off! You will see a new item in your top menu to control the behavior of the PowerMate. If you want it to launch when you start your Mac, add it to your startup items.\n\n![Where to find PowerMate Agent](\u002Fimages\u002FmenuBar.png)\n\nThe PowerMate acts as a scroll control, so if the active window or control has a scroll option, turning the dial will scroll the window or increase\u002Fdecrease selected value. You can reverse the scroll direction if you don't like the default scroll direction.\n\nThe PowerMate can also act as a mouse button. A momentary push of the button acts as a mouse click when in scroll mode. A long-press of the button acts as a right-click. You can also change the behavior so that a long-press acts as a double-click or switches between scroll and audio mode.\n\n**Audio mode**: Enable \"Audio mode\" in the menu and the knob adjusts system volume while the button toggles mute. When audio mode is active, the LED brightens and dims in sync with the amplitude of whatever is playing through your speakers. A short sound cue confirms the switch — up when entering audio mode, and down when returning to scroll. The menu bar icon's ring turns blue while audio mode is active so you can tell at a glance which mode you're in.\n\nHolding the **Fn key** temporarily flips the current mode — if audio is off, Fn switches to audio; if audio is on, Fn switches back to scrolling. **Long press** can also be configured to toggle between modes directly, which is handy if you switch often and prefer not to use the Fn key.\n\n| **Menu icon** | **Dock Icon** | **What it means** |\n|------------|---------|---------|\n| ![No PowerMate Connected menu icon](\u002Fimages\u002FnoPowermate.png) | \u003Cimg src=\"\u002F..\u002Fmain\u002Fimages\u002FDockIconDisconnected.png\" alt=\"Device Unavailable\" width=\"100\"\u002F> | No PowerMate connected to the computer. |\n| ![Scroll Mode active menu icon](\u002Fimages\u002FscrollMode.png) | \u003Cimg src=\"\u002F..\u002Fmain\u002Fimages\u002FDockIconScroll.png\" alt=\"Scroll Mode\" width=\"100\"\u002F> | Scroll Mode active |\n| ![Audio Mode active menu icon](\u002Fimages\u002FaudioMode.png) | \u003Cimg src=\"\u002F..\u002Fmain\u002Fimages\u002FDockIconAudio.png\" alt=\"Audio Mode\" width=\"100\"\u002F> | Audio Mode active |\n\n\n**Notch-aware Dock icon**: On MacBooks with a camera notch, the menu bar icon can be pushed behind the camera housing when many items are present. PowerMate Agent detects this automatically and shows a Dock icon so you can still access the menu. The Dock icon reflects the same three states (not connected, scroll mode, audio mode) as the menu bar icon. It disappears from the Dock when the menu bar icon is visible again.\n\nAll configuration choices (scroll direction, audio controls, long-press action) are saved automatically and restored the next time the app launches.\n\nOn first launch, PowerMate Agent will prompt you to grant **Accessibility** permission. When you first enable audio controls, it will also prompt for **Audio Capture** permission. Both are required for full functionality.\n\n![Permissions check dialog](\u002Fimages\u002FpermissionsDialog.png)\n\n![Accessibility Permissions](\u002Fimages\u002FaccessibilityPermissions.png)\n\n![Audio Permissions](\u002Fimages\u002FaudioPermissions.png)\n\nPretty simple, eh?\n\n## Customization\n\n### Custom sound cues\n\nMode-change sounds can be replaced with your own audio files. Place them in `scripts\u002FSounds\u002F` before building:\n\n| File | Played when |\n|---|---|\n| `ToAudio.aiff` | Switching into audio mode |\n| `ToScroll.aiff` | Switching back to scroll mode |\n\nAIFF or WAV are recommended. If a file is absent the built-in system sound is used instead.\n\n### Custom Dock icons\n\nWhen the Dock icon is visible (notch fallback), you can supply your own icons. Place ICNS files in `scripts\u002FIcons\u002F` before building:\n\n| File | Shown when |\n|---|---|\n| `DockIconScroll.icns` | Connected, scroll mode |\n| `DockIconAudio.icns` | Connected, audio mode |\n| `DockIconDisconnected.icns` | No device connected |\n\n1024×1024 source PNGs can be converted to ICNS with `sips` and `iconutil` (both included with macOS). If a file is absent the SF Symbol fallback is used for that state.\n\n## Technical details if you want to fork this repo and build your own.\n\nA small macOS driver that opens the **Griffin PowerMate** (VID `0x077d`, PID `0x0410`) over USB HID, reads its 6-byte reports, and exposes **button** and **rotation** events so you can map them to actions (e.g. scroll, click, media keys).\n\nThe device reports on the bus but does nothing by default on macOS; this library **seizes** the device and delivers events to your app.\n\n## Report format (from device)\n\n- **Byte 0**: Button state — `0` = released, `1` = pressed  \n- **Byte 1**: Rotation delta — signed; positive = clockwise, negative = counter‑clockwise (typically ±1 to ±7 per report). The device does not report speed directly; the driver derives **rotation rate** (deltas per second) from the time between reports.\n\n## Build and run\n\n```bash\ncd \u002Fpath\u002Fto\u002FUSB\nswift build\nswift run PowerMateDemo\n```\n\nWith the PowerMate plugged in, turn the knob or press the button; the demo prints events. Stop with Ctrl+C.\n\n## System-wide driver (PowerMate Agent)\n\n**PowerMateAgent** turns the knob and button into keyboard\u002Fscroll events that **any application** receives (browser, editor, etc.):\n\n- **Rotation** → vertical scroll, or **Up\u002FDown arrow keys** when a menu (or submenu) is focused, or **system volume** in audio control mode.\n- **Click** (short press) → **left mouse button** (at cursor), or **Return** when a menu is focused (chooses the highlighted item), or **mute\u002Funmute** in audio control mode.\n- **Long press** → **right mouse button**, or configurable to double-click or **toggle audio\u002Fscroll mode**.\n\n**Menu detection** uses the Accessibility API: when the focused UI element is a menu or submenu, rotation sends arrow keys and click sends Return. A long-press also enters a fallback “menu mode” (arrow keys until click or 5-second timeout) if Accessibility is not enabled.\n\n**Audio mode** — enable “Audio mode” in the menu, hold **Fn** to temporarily flip, or configure long press to toggle. A “Tink” plays when entering audio mode; a “Pop” plays when returning to scroll. Fn always XORs the current mode without a sound cue since it's held, not toggled.\n\n**LED VU meter** — when audio control mode is active, the LED brightness tracks the RMS amplitude of the system audio output in real time using `AudioHardwareCreateProcessTap`.\n\n**Persistent settings** — scroll direction, audio mode, and long-press action are remembered across launches.\n\nThe LED throbs while you turn and goes dim when idle; full brightness while the button is held.\n\n```bash\nswift run PowerMateAgent\n```\n\nOn first run, macOS will prompt for **Input Monitoring** permission. Grant it in **System Settings → Privacy & Security → Input Monitoring** and add (or enable) the Terminal or the built executable, then run the agent again.\n\nTo run in the background: `swift run PowerMateAgent &` or run the built binary `.\u002F.build\u002Fdebug\u002FPowerMateAgent` and add it to **Login Items** if you want it to start when you log in.\n\nTo create a **signed, notarized app** (or installer) so others can use it without security warnings, see **[DISTRIBUTION.md](DISTRIBUTION.md)**. You’ll need an Apple Developer account; users will need to grant **Input Monitoring**, **Accessibility**, and (if using audio controls) **Audio Capture** once on first use.\n\n## Use in your app\n\n### 1. Add the package\n\nIn your app’s `Package.swift` (or Xcode: File → Add Package Dependencies):\n\n```swift\ndependencies: [\n    .package(path: \"\u002Fpath\u002Fto\u002FUSB\"),  \u002F\u002F or your clone URL\n],\ntargets: [\n    .target(name: \"YourApp\", dependencies: [\"PowerMateDriver\"]),\n]\n```\n\n### 2. Start the driver and map events\n\n```swift\nimport PowerMateDriver\n\nlet driver = PowerMateDriver()\n\n\u002F\u002F Optional: use closures for simple mapping\ndriver.onRotate = { delta, rate in\n    \u002F\u002F delta > 0 = clockwise, delta \u003C 0 = counter-clockwise\n    \u002F\u002F rate = deltas per second (nil on first report); use for speed-dependent mapping\n    \u002F\u002F e.g. scroll: CGEventCreateScrollWheelEvent(..., delta * lineHeight)\n}\ndriver.onButtonDown = { \u002F* e.g. simulate click or toggle *\u002F }\ndriver.onButtonUp = { }\n\n\u002F\u002F Or use the delegate for all events\ndriver.delegate = self  \u002F\u002F implement PowerMateDriverDelegate\n\ndriver.start()\n\u002F\u002F Keep run loop running (e.g. main thread in an app)\n```\n\n### 3. Event types\n\n- `**PowerMateEvent.buttonDown**` \u002F `**buttonUp**` — knob pressed \u002F released  \n- `**PowerMateEvent.buttonClick**` — short press and release (under `longPressThreshold`).  \n- `**PowerMateEvent.buttonLongPress**` — press held at least `longPressThreshold`, then release.  \n- `**PowerMateEvent.rotate(delta: Int, rate: Double?)**` — `delta` is the signed step count (e.g. +1, -2); `rate` is derived rotation speed in deltas per second (nil on first report).\n\nSet `**longPressThreshold**` (default 0.4 seconds) to tune what counts as a long press. Use `**onClick**` and `**onLongPress**` (or the delegate) for separate handling.\n\nUse `driver.isConnected` to see if the device is currently opened.\n\n## LED (blue light in base)\n\nThe base has a blue LED you can use for feedback. Control it only when the device is connected (`isConnected == true`).\n\n- `**setLEDBrightness(_ value: UInt8)**` — static brightness 0–255 (0 = off).\n- `**setLEDPulseAsleep(_ on: Bool)**` \u002F `**setLEDPulseAwake(_ on: Bool)**` — turn the built‑in pulse when “asleep” or “awake” on or off.\n- `**setLEDPulseMode(table:op:arg:)**` — custom pulse: `table` 0–2, `op` 0 = slower, 1 = normal, 2 = faster, `arg` 1–255 for op 0\u002F2.\n\nLED commands use USB vendor control requests (same protocol as the Linux driver). They return `true` if the command was sent successfully. If the USB device is busy (e.g. another process has it open), LED calls may fail.\n\n## Mapping to system actions\n\n- **Scrolling**: In `onRotate`, create a scroll wheel `CGEvent` (e.g. `CGEventCreateScrollWheelEvent`) and post it, or feed the delta into your own scroll logic.  \n- **Click**: In `onButtonDown` \u002F `onButtonUp`, create and post a mouse click `CGEvent`, or call your own click handler.  \n- **Media \u002F other**: Map `onRotate` and `onButtonDown` to whatever you need (e.g. volume, key equivalents).\n\nPosting events may require **Input Monitoring** (or **Accessibility**) in **System Settings → Privacy & Security** for your app.\n\n## If the device doesn’t respond\n\n1. **Unplug and replug** the PowerMate, then run your app again.\n2. **Quit other software** that might be using the PowerMate (e.g. old PowerMate apps).\n3. The driver uses `kIOHIDOptionsTypeSeizeDevice` so it takes exclusive access; only one process can use it at a time.\n\n## Requirements\n\n- macOS 13+  \n- Swift 5.9+\n\n## References\n\n- [Linux PowerMate driver](https:\u002F\u002Fgitlab.eclipse.org\u002Feclipse\u002Foniro-core\u002Flinux\u002F-\u002Fblob\u002Fmaster\u002Fdrivers\u002Finput\u002Fmisc\u002Fpowermate.c) (report format: byte 0 = button, byte 1 = rotation)  \n- [Resurrecting the Griffin PowerMate on Linux](https:\u002F\u002Fwww.gilesorr.com\u002Fblog\u002Fpowermate-on-linux.html)  \n- Apple IOKit HID: `IOHIDManager`, `IOHIDDeviceOpen`, `IOHIDDeviceRegisterInputReportCallback`\n\n### Versions\n\n#### 1.0.6\n\nPowerMate no longer prevents device sleep.\n\n#### 1.0.5\n\nAdded notch-aware Dock icon fallback: when the menu bar icon is hidden behind the camera housing, a Dock icon appears automatically and reflects the current state (not connected, scroll mode, audio mode). Uses custom ICNS files for all three Dock icon states.\n\n#### 1.0.4\n\nMenu bar icon now indicates when there is no PowerMate connected.\n\n#### 1.0.3\n\nAdded audio cue for when mode changes.\nIcon now has blue ring when in Audio Mode.\nAudio Mode is now called... Audio mode.\n\n#### 1.0.2\n\nAdded LED VU meter (tracks system audio amplitude via `AudioHardwareCreateProcessTap`), Fn-key mode flip, long-press toggle for audio\u002Fscroll mode, Audio Capture permission handling, blue menu bar icon when audio mode is active, and custom sound file support. Updated app identifier string.\n\n#### 1.0.1\n\nAdded audio controls (volume + mute), settings persistence, and accessibility permission check. Also made scrolling smoother.\n\n#### 1.0.0\n\nInitial release. Includes scrolling and clicking, with optional double-click or right-click for long presses.\n","该项目为Griffin PowerMate设备提供了一个适用于现代macOS的小型驱动程序。其核心功能是让这个旋钮装置能够作为滚动控制或鼠标按钮使用，并且可以通过菜单栏调整其行为，如改变滚动方向、切换音频模式等。在音频模式下，旋钮可以调节系统音量，同时LED灯会根据播放声音的强度变化而明暗。该驱动适合需要额外物理控制器以辅助视频和音频制作的专业人士，或是对复古技术感兴趣的用户，在日常工作中提供便捷的操作体验。","2026-06-11 03:56:05","CREATED_QUERY"]