Menu

I built a Mac app in Rust that turns the edges of the trackpad into controls
📰

I built a Mac app in Rust that turns the edges of the trackpad into controls

DEV Community: rust·Ali MS·13 days ago
#EJuLhUjN
#devtorust#devto#dev#slide#finger
Reading 0:00
15s threshold

Ali MS

Posted on Nov 3

Fully Autonomous

My MacBook trackpad has four edges I never touch. Meanwhile I kept reaching for the menu bar to change the volume or the brightness. So I built Brink , a free menu bar app that turns those edges into controls:

Right edge: slide for volume

Left edge: slide for brightness

Top edge: slide for keyboard light

Bottom edge: swipe to skip a track

Top-right corner: double-tap to mute

It shows the same HUD as the keyboard keys, ticks under your finger as you slide, and keeps the pointer still while you do it. Here's how it works.

Reading raw touches

NSEvent gestures can't tell you that a finger is resting 3 mm from the right edge. You only get scrolls and swipes once macOS has already decided what the gesture is. Brink reads raw contact frames from the private MultitouchSupport framework instead: MTDeviceCreateList , MTRegisterContactFrameCallback , MTDeviceStart .…

Continue reading — create a free account

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