A macOS framework for controlling the Saitek/Logitech X52 Pro HOTAS (Hands On Throttle And Stick) flight controller.
- Control MFD (Multi-Function Display) text on all three lines
- Set LED colors for all programmable LEDs (A, B, D, E, T1-T3, POV, Clutch)
- Adjust MFD and LED brightness
- Set clock time and timezone for all three clock displays
- Enable shift indicator and LED blinking effects
- Swift-friendly API with native Swift wrapper
- macOS 10.13+
- Xcode 14+
- Saitek/Logitech X52 Pro flight controller
-
Clone the repository with submodules:
git clone --recursive https://github.com/yourusername/x52pro.git
-
Open
x52pro.xcworkspacein Xcode -
Build the
X52Proframework target
import X52Pro
// Connect to device
guard let device = X52Pro() else {
print("X52 Pro not connected")
return
}
// Set MFD text
device.setMFDText(line1: "Hello", line2: "World", line3: "!")
device.synchronize()
// Set LED colors
device.setLED(.a, color: .green)
device.setAllLEDs(color: .amber)
device.synchronize()
// Set brightness
device.setMFDBrightness(0.5)
device.setLEDBrightness(0.75)
device.synchronize()
// Set clock to current time
device.setClock()
device.synchronize()#import <X52Pro/X52ProDevice.h>
X52ProDevice *device = [X52ProDevice connectedDevice];
if (device) {
[device setLine1:@"Hello"];
[device setLine2:@"World"];
[device setLedA:kLedColorGreen];
[device synchronize];
}| Color | Description |
|---|---|
.off |
LED off |
.red |
Red |
.amber |
Amber/Orange |
.green |
Green |
Multi-color LEDs that support off/red/amber/green: a, b, d, e, t1, t2, t3, pov, clutch
Fire and Throttle LEDs only support on/off states.
The project also builds command-line tools for testing:
x52cli- Command-line interface for controlling the devicex52test- Interactive test program
x52pro/
├── x52pro.xcworkspace # Xcode workspace
├── x52pro/ # Main Xcode project
│ └── X52Pro/ # Framework source
│ ├── X52Pro.swift # Swift wrapper
│ ├── X52ProDevice.h # Objective-C interface
│ └── X52ProDevice.m # Objective-C implementation
├── X52ProExample/ # Example SwiftUI app
├── libusb/ # libusb submodule
└── x52pro-linux/ # x52pro-linux submodule
This project uses the following libraries as git submodules:
- libusb - USB access library (LGPL v2.1)
- x52pro-linux - X52 Pro library (GPL v2)
If your app uses App Sandbox, USB device access will be blocked. You must either:
- Disable App Sandbox in your entitlements
- Or run without sandboxing for USB access
Ensure the X52 Pro is connected via USB and recognized by macOS. Check System Information > USB to verify the device is detected.
This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.
- Nirenjan Krishnan for the x52pro-linux library
- The libusb developers