Skip to main content

attack3-hud

Cross platform HID controller diagnostics HUD for the Logitech Attack 3 joystick.

Installation

pip install attack3-hud

Or install from source with uv:

git clone https://github.com/skorm11x/attack3-hud
cd attack3-hud
uv sync

Running with uv

This project uses uv. The main commands are:

# Run the GUI from the installed package entry point
uv run attack3-hud

# Or run the source file directly
uv run python src/attack3_hud/main.py

uv run will sync the lockfile and create/use the project virtual environment automatically.

Make sure the Logitech Attack 3 joystick is plugged in before launching; the program exits immediately if no joystick is detected.

Other useful commands

uv sync                # install dependencies and the package
uv build               # build distributable wheels/sdists
uv pip install -e .    # editable install (if you prefer)

The attack3-hud command is defined by the [project.gui-scripts] entry point in pyproject.toml.

Library usage

You can also import the package as a library:

from attack3_hud import Attack3Controller, Attack3HUD, Calibration

# Poll controller state in your own loop
controller = Attack3Controller()
while True:
    state = controller.read()
    print(state.x, state.y, state.throttle, state.buttons)

# Or open the diagnostics window
hud = Attack3HUD(controller=controller)
hud.run()

Calibration and button-name remapping live in the Calibration object:

cal = Calibration()
cal.axes[0].invert = True
cal.axes[1].deadzone = 0.1
controller = Attack3Controller(calibration=cal)

Attack3HUD.run() takes over the Pygame event loop. If your own app already owns the window and loop, embed the HUD instead:

hud = Attack3HUD(controller=controller)  # pass your own controller to avoid stealing it

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        else:
            hud.handle_event(event)  # returns True if the HUD consumed it

    state = controller.read()
    hud.draw(screen.subsurface(pygame.Rect(400, 0, 800, 500)), state)
    pygame.display.flip()
  • draw(surface, state) renders into any pygame.Surface — useful for a side panel or a subsurface of your own window.
  • handle_event(event) forwards mouse/keyboard input (button renaming still works).
  • controller.read() polls raw + calibrated state and reconnects if the device re-appears; controller.close() / hud.close() release the device cleanly.
  • Attack3HUD.run() is standalone-only: it owns the loop and calls pygame.quit().

Metadata

Release files for attack3-hud 0.1.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 attack3-hud 0.1.0
File Size Uploaded
attack3_hud-0.1.0.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for attack3-hud 0.1.0
File Interpreter ABI Platform
attack3_hud-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / attack3_hud-0.1.0.tar.gz

Download URL attack3_hud-0.1.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b17f6edbce349fd34a2adbe07858656bc98f88afae0ecc4df3112ff8b3ad270e
BLAKE2b-256 checksum
How to use checksums
eeb123aa21b2c0a7777e01ecbdac43049822895a8bfa8852f5a5a2b7edc3c568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / attack3_hud-0.1.0-py3-none-any.whl

Download URL attack3_hud-0.1.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bda16b8160063d2a64ca7c383edb527c16698e7f9416c2bc796ad1f6716c6bd1
BLAKE2b-256 checksum
How to use checksums
9e8a44bd6911791040eb4250dd6573175d1dd6d76c0ea9fe609528afa140003d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.20 {"installer":{"name":"uv","version":"0.12.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.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