GitPedia

JoyConSwift

IOKit wrapper for Nintendo Joy-Con and ProController (macOS, Swift)

From magicien·Updated June 28, 2026·View on GitHub·

IOKit wrapper for Nintendo Joy-Con and ProController (macOS, Swift) The project is written primarily in Swift, distributed under the MIT License license, first published in 2019. Key topics include: gamepad, iokit, joy-con, macos, nintendo-switch.

Latest release: v0.1.1
June 30, 2020View Changelog →

JoyConSwift

IOKit wrapper for Nintendo Joy-Con and ProController (macOS, Swift)

Installation

Using CocoaPods

Add the following to your Podfile:

rb
pod 'JoyConSwift'

Set USB Capability

To use controllers, you need to check Signing & Capabilities > App SandBox > USB in your Xcode project.

<img width="367" alt="usb_capability" src="https://user-images.githubusercontent.com/1047810/82137704-5f7ea980-9855-11ea-8f21-0e6c2ad518e9.png">

Usage

swift
import JoyConSwift // Initialize the manager let manager = JoyConManager() // Set connection event callbacks manager.connectHandler = { controller in // Do something with the controller controller.setPlayerLights(l1: .on, l2: .off, l3: .off, l4: .off) controller.enableIMU(enable: true) controller.setInputMode(mode: .standardFull) controller.buttonPressHandler = { button in if button == .A { // Do something with the A button } } } manager.disconnectHandler = { controller in // Clean the controller data } // Start waiting for the connection events manager.runAsync()

Documentation

See JoyConSwift Documentation

Thanks to

dekuNukem/Nintendo_Switch_Reverse_Engineering - A look at inner workings of Joycon and Nintendo Switch

See also

JoyKeyMapper - Nintendo Joy-Con/ProController Key mapper for macOS

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub →

This article is auto-generated from magicien/JoyConSwift via the GitHub API.Last fetched: 6/29/2026