ardaku / stick

Rust library for platform-agnostic asynchronous gamepad, joystick, and flightstick interaction
https://crates.io/crates/stick
Apache License 2.0
76 stars 14 forks source link
controller flight-controller gamepad joystick joystick-library joysticks rust

Stick

Folders in this repository:

Xtask

Stick uses the xtask repository model to have various scripts written in Rust process controller data, also allowing serde to not be a direct dependency.

Available Commands

TOML Format

File names are 64-bit hexadecimal values with leading zeros followed by .toml within a folder referring to the platform.

name = "My Controller Name"
type = "xbox"

[remap]
TriggerR = {} # Ignore events
TriggerL = {}
HatUp = "Up" # Map hat to dpad when you're not using a flightstick
HatDown = "Down"
HatLeft = "Left"
HatRight = "Right"
CamX = { event = "CamX", deadzone = 0.075 } # Adjust deadzones
CamY = { event = "CamY", deadzone = 0.075 }
JoyZ = { event = "TriggerR", max = 1024 } # Set higher-precision axis ranges (usually 255)
CamZ = { event = "TriggerL", max = 1024 }

type

Type can be any of the following:

License

Copyright © 2017-2023 The Stick Contributors.

Licensed under any of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as described above, without any additional terms or conditions.

Help

If you want help using or contributing to this library, feel free to send me an email at aldaronlau@gmail.com.