macOS support for the Surface Dial

Related tags

SwiftUI App mac-dial
Overview

Mac Dial

macOS support for the Surface Dial. The surface dial can be paired with macOS but any input results in invalid mouse inputs on macOS. This app reads the raw data from the dial and translates them to correct mouse and media inputs for macOS.

Building

Make sure to clone the hidapi submodule and build the library using the build_hidapi.sh script. Note: This app depends on a hidapi fork, check the submodule to see what changed. App should then build with XCode.

You can find universal builds of the app under "releases". Note that these builds can be outdated.

Usage

The app will continously try to open any Surface Dial connected to the computer and then process inpout controls. You will need to pair and connect the device as any other bluetooth device.

The app currently supports two modes:

  • Scroll mode: Turning the dial will result in scrolling. Pressing the dial is interpreteded as a mouse click at the current cursor position.
  • Playback mode: Turning the dial controls the system volume of your mac. Pressing the dial plays / pauses any current playback while a double click sends the "next" media action.

To change mode, click the Mac Dial icon in the system menu bar.

If you want to app to run at startup you will need to add it yourself to the "login items" for your user.

Improvements

  • More input modes
  • Change input mode using the dial itself
  • Smarter device discovery (currently tries to open the dial every 50 ms)
Comments
  • Feature: Haptics and Sensitivity

    Feature: Haptics and Sensitivity

    Description

    Enabled haptics by sending an HID message to the dial. This feature also introduces a change to how sensitivity works. Previously sensitivity increased or decreased the number of lines scrolled or amount of volume change, but did not truly change how sensitive the dial was. Now it works like changing the DPI setting on a mouse; it increases the amount of events generated per angle physically rotated. This way the haptics match the sensitivity.

    Some changes may be necessary to retune the multiplier value in ScrollController.

    Fixes #15

    Type of change

    • [x] New feature (non-breaking change which adds functionality)

    How Has This Been Tested?

    Launching mac-dial restores previous settings. Quitting mac-dial turns off haptics and restores the default sensitivity. Changing sensitivity and enabling/disabling haptics works as expected. Project generates no new errors and uses general architecture of original project to achieve the feature.

    opened by jerrywoohu 12
  • Choose media player

    Choose media player

    On my MacBook Pro (silicon), the dial volume does what it should do. When the Qobuz (a streaming service like Tidal) media player is active, the button can pause/start a song and double clicking skips to the next song. On my MacMini (silicon) however, the volume controls work the same, but pressing the button always opens Apple Music and will not control another media app that is active. Would it be possible to assign a default media app?

    opened by MacSpikes 3
  • Double Click Issue in Playback Mode

    Double Click Issue in Playback Mode

    Such a luxurious feeling using the dial for volume. Though I'm finding that when I double press in playback mode, instead of progressing to the next track as expected, it first pauses the music and then progresses to the next song (leaving it in a stopped state) - Using Apple music on OS X 12.0.1

    opened by brikuth 3
  • I get this error when I attempt to build in Xcode. what am I doing wrong?

    I get this error when I attempt to build in Xcode. what am I doing wrong?

    ld: warning: directory not found for option '-L/Users/daddy/Documents/GitHub/mac-dial/lib/hidapi/build/src/mac' ld: library not found for -lhidapi clang: error: linker command failed with exit code 1 (use -v to see invocation)

    opened by rkasha 2
  • Suggestion: Reverse the wheel and keybind on click

    Suggestion: Reverse the wheel and keybind on click

    I don't know if its possible but if the ability to reverse the wheel functionality or even setting a keybind on click. Awesome project by the way, I've been using it for days now.

    opened by kflore16 2
  • Virtual detents

    Virtual detents

    Do we know if the dial supports virtual detents? This would be a very cool feature to add, for feedback.

    I also thought I read somewhere that it supports vibration feedback.

    opened by jeromebaum 1
  • Added option to change the scrolling direction

    Added option to change the scrolling direction

    Added Standard and Natural Scrolling Directions Standard: Clockwise rotation scrolls up, counter clockwise rotation scrolls down Natural: clockwise rotation scroll down, counterclockwise rotation scrolls up

    set the default to natural

    This is my first time working in swift so please review

    opened by ShadyNawara 1
  • cannot find xxx in scope

    cannot find xxx in scope

    Why it gives me such error: cannot find 'hid_get_manufacturer_string' in scope, and also 'hid_get_serial_number_string', 'hid_close', 'hid_open' etc.?

    opened by xusongpei 1
  • use dial controls the slide

    use dial controls the slide

    Maybe it is a stupid question. I want to use the dial to control a slide that I had built in a webapp by python on my Mac, what should I do? Do I need to change something in the code? Or if I want to use python to read the value of the rotation of the dial, how should I do it? I had never used swift before, so I am a little bit confused. Thank you

    opened by xusongpei 1
  • Granular Volume Control

    Granular Volume Control

    This is a great tool, thank you. In playback mode, is any way to implement the granular volume control that you can do while holding option+shift while using the volume buttons on a keyboard?

    opened by brikuth 1
  • Cannot find 'hid_monitor' in scope

    Cannot find 'hid_monitor' in scope

    The cpu of my mac is Apple M1 Pro, when i debug the project:

    image

    I have clone the hidapi and make :

    $ sudo make install Consolidate compiler generated dependencies of target hidapi_darwin [100%] Built target hidapi_darwin Install the project... -- Install configuration: "Release" -- Installing: /usr/local/lib/cmake/hidapi/libhidapi.cmake -- Installing: /usr/local/lib/cmake/hidapi/libhidapi-release.cmake -- Installing: /usr/local/lib/cmake/hidapi/hidapi-config-version.cmake -- Installing: /usr/local/lib/cmake/hidapi/hidapi-config.cmake -- Installing: /usr/local/lib/libhidapi.a -- Installing: /usr/local/include/hidapi/hidapi.h -- Installing: /usr/local/include/hidapi/hidapi_darwin.h -- Installing: /usr/local/lib/pkgconfig/hidapi.pc

    opened by lzlz99 0
  • Version 1.4.1

    Version 1.4.1

    Main update here is that I've got rid of usbhid library, using IOKit framework instead. That resulted in a smaller code. Other updates:

    • added support for the haptics
    • added "third" click to be able to use "previous track" event
    • changed icons, to my taste they look better in the menubar
    • added support for the localization (but only English is available for now)

    Currently there is only one problem. I can't figure out how to make the dial not go to sleep. Or when resuming, send an event like "resume was made by pressing the button". Everything else is fun, but absence of this feature makes whole application much worse.

    Will look into this more (maybe in 8 more months, hehe).

    opened by bealex 0
  • Custom functions to dial click

    Custom functions to dial click

    It would be cool to have some features offered for the click of the dial. It is on play pause in playback, and click (?) with scroll mode, but I think it would be cool to be able to customize what the dial click does, including a "change dial mode" function, maybe on long press. Just suggestions, if you can do that. It's an amazing tool already, thanks

    opened by piereligio 2
  • How to contribute

    How to contribute

    I have a contribution that I'd like to create a PR for. I've added the ability to send arrow keys. I am planning to experiment with this for navigating code.

    What do I need to do to add these contributions? Specifically, how does it work in terms of the license file? I assume I should not modify this, but I also don't think I'm allowed to implicitly claim that the code I added is written by you.

    I'm hoping to make some more contributions over time if this experiment works out, so would appreciate any guidance.

    opened by jeromebaum 1
  • Input not working after upgrading app

    Input not working after upgrading app

    Just installed 1.3 on my M1 Mini and while the app shows my surface dial is connected, turning or pressing the dial does nothing. It was working as designed before installing 1.3

    Steps: Install Mac-dial 1.3 from zip (replacing previous version) Restart OS Start Mac-dial Select "Scroll mode" OR "Playback Mode" Scrolling dial does not scroll safari page or adjust volume (respective of mode)

    (I see "Surface dial 123456789ABC Connected" in the menubar dropdown)

    What other information can I offer?

    opened by super7oas7 5
Releases(releases/1.4)
Owner
Andreas Karlsson
Programming languages • Emulators • Creative programming • Hacking • Networking • Graphics
Andreas Karlsson
"Podman for macOS" is a macOS frontend for Podman.

Podman for macOS "Podman for macOS" is a macOS frontend for Podman. It can be used to start and stop both the Podman Machine and its running container

Victor Gama 573 Jan 5, 2023
SwiftUI with support for WebAssembly

SwiftWebUI and WASM This is a fork of the incredible SwiftWebUI to support WebAssembly via swiftwasm. What does it do? This repo allows you to run you

Carson Katri 362 Dec 11, 2022
Shortcuts support for Micro.blog

Ringgold The intial goal of this project is to provide Shortcuts support for Micro.blog. It may be expanded to include support for other Micropub impl

Maurice Parker 9 Nov 2, 2022
An iOS app that lets user quickly jot down thoughts with Markdown support

Thoughtless An iOS app that lets user quickly jot down thoughts with Markdown support. Description Perhaps you are often in a situation where you want

Yohannes Wijaya 25 May 24, 2022
Firebase Cloud Firestore support library for iOS. 🧢

?? Ballcap-iOS Ballcap is a database schema design framework for Cloud Firestore. Why Ballcap Cloud Firestore is a great schema-less and flexible data

1amageek 229 Jan 2, 2023
SwiftUI MovieDB prototype app built with Xcode 11 Beta & macOS 10.15 Catalina

SwiftUI MovieDB iOS 13 App SwiftUI MovieDB prototype app built with Xcode 11 Beta & macOS 10.15 Catalina Requirements macOS 10.15 Catalina Xcode 11 Be

Alfian Losari 297 Dec 17, 2022
Stock is a MacOS menu bar app that helps you quickly save a web link, a file link, or a text by using drag and drop

Stock is a MacOS menu bar app that helps you quickly save a web link, a file link, or a text by using drag and drop

シュンジョーァ 19 Dec 4, 2022
iOS app that detects LaTeX symbols from drawings. Built using PencilKit, SwiftUI, Combine and CoreML for iOS 14 and macOS 11.

DeTeXt Finding the symbol you want to use in LaTeX can be hard since you can't memorize all the possible commands and packages for every symbol you mi

Venkat 73 Dec 8, 2022
Completed Project for Cross Platform Image Filter SwiftUI macOS & iOS App

Completed Project for Cross Platform Image Filter SwiftUI macOS & iOS App Follow the tutorial at alfianlosari.com Features Filter image using predefin

Alfian Losari 73 Dec 19, 2022
🎲 100% SwiftUI 2.0, classic 2048 game [SwiftUI 2.0, iOS 14.0+, iPadOS 14.0+, macOS 11.0+, Swift 5.3].

swiftui-2048 If you like the project, please give it a star ⭐ It will show the creator your appreciation and help others to discover the repo. ✍️ Abou

Astemir Eleev 174 Dec 17, 2022
Exposing macOS Services through a Catalyst app

CatalystServices This is a simple example to show how you can implement the macOS Services system in your Catalyst app. The services you expose are pr

Steven Troughton-Smith 33 Oct 26, 2022
A macOS Monterey Patcher that will be coming soon.

A macOS Monterey UI patcher. It uses my MontereyPatcher-CLI patcher as its base, and it will hopefully build upon that. Resources: MontereyPatcher-CLI

Solomon Wood 11 Aug 18, 2021
Informant is a macOS menu bar app that lets you inspect files with a single click. 🔍

Informant Inspect files with a single click. Introduction Welcome! If you're not sure what Informant is or what it does please check out informant-app

Ty Irvine 31 Nov 7, 2022
A SwiftUI dynamic property wrapper for fetching media from your photo library. (iOS, tvOS, macOS)

Media Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+ A package for simplifying the user of the camera and the user's ph

SwiftUI+ 20 Nov 16, 2022
An iPhone Simulator "Wrapper" for SwiftUI Apps on macOS

SwiftUIPhone Run a SwiftUI app (or any SwiftUI view) in an iPhone Simulator "wrapper", directly on macOS! To be clear, this is not an iPhone Simulator

Justin Kaufman 7 May 20, 2022
Native and encrypted password manager for iOS and macOS.

Open Sesame Native and encrypted password manager for iOS and macOS. What is it? OpenSesame is a free and powerful password manager that lets you mana

OpenSesame 431 Dec 28, 2022
Grid-based app for macOS Catalyst (Mac Idiom) with navigation stack

Catalyst Grid App Simple Catalyst example (Mac idiom) of a grid-based app with a push/pop navigation stack. Includes back button in toolbar that auto-

Steven Troughton-Smith 120 Nov 14, 2022
Seaglass is a truly native macOS client for Matrix. It is written in Swift and uses the Cocoa user interface framework.

Seaglass is a truly native macOS client for Matrix. It is written in Swift and uses the Cocoa user interface framework.

null 1 Jan 17, 2022
A simple, but powerful UI patcher for macOS Big Sur designed for everyone.

What is Patched Sur? Patched Sur is a UI patcher for macOS Big Sur, designed to make it easy to run macOS 11 on unsupported Macs. This patcher hopes t

Ben 274 Dec 24, 2022