Skip to content

Add macOS support#113

Closed
krystophny wants to merge 3 commits intopeteonrails:mainfrom
krystophny:upstream-pr-macos
Closed

Add macOS support#113
krystophny wants to merge 3 commits intopeteonrails:mainfrom
krystophny:upstream-pr-macos

Conversation

@krystophny
Copy link
Collaborator

Summary

This adds full support for running voxtype on macOS.

Hotkey capture:

  • CGEventTap-based global hotkey detection
  • FN/Globe key support via SecondaryFn flag detection
  • Requires Accessibility permissions

Text output:

  • CGEvent-based text injection
  • Clipboard support via pbcopy/pbpaste

Build configuration:

  • Conditional compilation for platform-specific code
  • evdev moved to Linux-only dependency
  • core-graphics and core-foundation added for macOS

Other changes:

  • Platform-specific default hotkey: FN on macOS, SCROLLLOCK on Linux
  • cfg guards for Linux-specific code
  • Cross-platform tests

Dependencies

Depends on #112 (replace inotify with notify crate)

Test plan

  • Build and run on macOS
  • Verify hotkey detection works (FN key)
  • Verify text injection works
  • Build on Linux (verify no regressions)
  • Run tests on both platforms

@krystophny
Copy link
Collaborator Author

@peteonrails here are the three PRs once more restructured. As said, feel free to either pick parts or use them as a whole.

This switches the device hotplug detection in the evdev listener from
using inotify directly to using the notify crate, which abstracts
filesystem watching across platforms.

Benefits:
- Cleaner dependency (notify is already used for status --follow)
- The notify crate is better maintained and more widely used
- Prepares codebase for future cross-platform support

The notify crate uses inotify internally on Linux, so behavior is
unchanged on the primary platform.
This adds full support for running voxtype on macOS:

**Hotkey capture:**
- CGEventTap-based global hotkey detection (requires Accessibility permissions)
- FN/Globe key support via SecondaryFn flag detection
- Platform-specific default: FN on macOS, SCROLLLOCK on Linux

**Text output:**
- CGEvent-based text injection for typing transcribed text
- Clipboard support via pbcopy/pbpaste

**Build configuration:**
- Conditional compilation for platform-specific code
- evdev moved to Linux-only dependency
- core-graphics and core-foundation added for macOS

**Other changes:**
- cfg guards for Linux-specific code (evdev, inotify, .init_array)
- Cross-platform test using printf instead of echo -n
- Documentation updates for macOS options
@peteonrails peteonrails mentioned this pull request Jan 27, 2026
5 tasks
@peteonrails
Copy link
Owner

Superseded by #129 which includes the macOS support with additional features (menu bar, notifications, Homebrew packaging). Thank you for the foundational work on macOS support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants