Menu

7 macOS details behind an AI dictation app written in Rust
📰

7 macOS details behind an AI dictation app written in Rust

DEV Community: rust·Sven Müller·12 days ago
#8h6tinEh
#devtorust#devto#dev#macos#lowspeak
Reading 0:00
15s threshold

Lowspeak is an open-source menu bar app for AI speech-to-text in every Mac app: hold fn, talk, let go, and the text appears at the cursor. It transcribes online with Groq (free on Groq's free tier with your own key) or OpenAI, or offline with Whisper and NVIDIA Parakeet, and it is written in Rust on AppKit through the objc2 crates. Here are seven places where macOS needed more care than expected, with the code that handles them.

1. fn only arrives if you ask for nothing else

To an event tap, the fn key is a modifier change with keycode 63 and the MaskSecondaryFn flag. The catch: as soon as an event tap also asks for key-down or key-up events, macOS stops delivering fn to it.

// Only flagsChanged: adding keyDown/keyUp makes macOS stop delivering fn events.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.