Skip to main content

Logitech X52/X52Pro module

Most of the information about how to configure the devices comes from a GUI program called gx52, created by Roberto Leinardi. His project can be found at https://github.com/leinardi/gx52 . Many thanks to him for his efforts, if you need a GUI app to set up your HOTAS, consider using his program.

If you want a command line tool, there is a utility called x52pro-linux, by nirenjan, available at https://github.com/nirenjan/x52pro-linux . It has a C library that you can use in your own software and a CLI tool to set you HOTAS. It's even available as packages in Debian and Arch.


How to use it

  • Initializing the module
from x52 import x52

# locate all devices
joystick = x52()

# list devices
print(joystick.devices)
  • Setting button colors
# sets POV LED to green on device 0
joystick.set_led_color(joystick.devices[0], 'pov', 'green')

# Blinks I button and POV Hat 1
joystick.set_led_blink(joystick.devices[0], 'blink')

# stops blinking
joystick.set_led_blink(joystick.devices[0], 'solid')

Valid colors for POV Hat 2 and Throtlle are on and off. For all other buttons values are amber, red, green or off.

For blinking status, values are blink and solid.

  • LED and MFD brightness

Brightness of LEDs and MFD can be set to values between 0 (which turns them off) and 127 (maximum).

You can set the brightness like this:

# set brightness to 60
joystick.set_brightnes(joystick.devices[0],'mfd',60)
joystick.set_brightnes(joystick.devices[0],'led',60)

# turns the lighting off
joystick.set_brightnes(joystick.devices[0],'mfd',0)
joystick.set_brightnes(joystick.devices[0],'led',0)
  • Sets the clock and date.

WARNING: The clock does NOT update itself. You need to call this method and update clock 1 everytime you want it to advance.

Setting the date is only possible when also setting the main clock (identified by 1) When setting clocks 2 and 3, is not possible to set the date, since those 2 only accept offsets from the main clock. The offsets are a number of minutes, between -1023 and 1023.

When setting the date, you can choose the format, valid options are 'DMY' (Day.Month.Year), 'MDY' (Mont.Day.Year) or 'YMD' (Year.Month.Day). The clocks can also be set to 24h or AM/PM modes.

Setting time and date:

# set current date and time to clock 1, usind DMY and 24h formats
nowtime=datetime.now
joystick.set_clock(device=joystick.devices[0], clock=1, cur_time=nowtime , date_format = 'DMY', is24h = True)

# set clock 2 to 45min ahead
joystick.set_clock(device=joystick.devices[0], clock=2, cur_time=45 )
  • Shift indicator

This indicator does nothing to the actual performance or functionality of the X52. It's just there so the official software can tell you when it's using different settings.

You can turn it on or off like this:

#turn it on
joystick.set_shift(joystick.devices[0], 'on')

#turn it off
joystick.set_shift(joystick.devices[0], 'off')
  • MFD Text

You can write on the 3 text lines of the MFD. Lines are limited to 16 characters, anything beyond that will be discarded. There are issues with non-US ASCII text, so try not to write anything fancy. Just call the method with the line number (1 to 3) and the text. A blank line ('') erases the line.

Examples:

# write a text to line 1
joystick.write_mfd(joystick.devices[0], 1, 'A line of Text')
joystick.write_mfd(joystick.devices[0], 1, 'This text is too big and will be truncated')

# Erases line 1
joystick.write_mfd(joystick.devices[0], 1, '')

Metadata

Release files for x52-control 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for x52-control 1.0.0
File Size Uploaded
x52-control-1.0.0.tar.gz 12.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for x52-control 1.0.0
File Interpreter ABI Platform
x52_control-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / x52-control-1.0.0.tar.gz

Download URL x52-control-1.0.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e975c42e9193e850c6d63d72ce5f5661f7639e4997aecbf8f228610d2b97cd79
BLAKE2b-256 checksum
How to use checksums
c709da01f8c06a85fcbc7a5f58560eb7e6c1b8cae6b9fd48f13f507615506f4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

Release files / x52_control-1.0.0-py3-none-any.whl

Download URL x52_control-1.0.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5c6688e6e2b73561847c317159128130e536427f48c6e4714de3e8ad34dec45
BLAKE2b-256 checksum
How to use checksums
104de1777179d85ecfc2f040b9969ca09d4c6573cc4f563425ff64bc172ae2a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page