Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add get_capabilities_ex #24

Merged
merged 2 commits into from
Dec 17, 2023
Merged

add get_capabilities_ex #24

merged 2 commits into from
Dec 17, 2023

Conversation

Lokathor
Copy link
Owner

@Lokathor Lokathor commented Dec 16, 2023

Since we already also have GetStateEx, this closes #16

@Lokathor
Copy link
Owner Author

@MaulingMonkey , @djeedai

@djeedai
Copy link

djeedai commented Dec 17, 2023

Thanks @Lokathor! Trying to test but all fields are private, so I'm not sure what's the usage pattern for XINPUT_CAPABILITIES_EX?

@djeedai
Copy link

djeedai commented Dec 17, 2023

Other than that, this seems to work:

use rusty_xinput::XInputHandle;

fn main() {
    let handle = XInputHandle::load_default().unwrap();
    let caps_ex = handle.get_capabilities_ex(0).unwrap();
    println!(
        "caps_ex: {:X?} {:X?} {:?} {:?}",
        caps_ex.vendor_id, caps_ex.product_id, caps_ex.revision_id, caps_ex.a4
    );
caps_ex: 45E 2E0 0 0

45E: Microsoft Corp.
2E0: Xbox One Wireless Controller

https://devicehunt.com/view/type/usb/vendor/045E/device/02E0

@Lokathor
Copy link
Owner Author

all fields are private

Good point, definitely didn't want to forget about that part.

@Lokathor Lokathor merged commit af184cc into master Dec 17, 2023
1 check passed
@Lokathor Lokathor deleted the get_caps branch December 17, 2023 23:27
@Lokathor
Copy link
Owner Author

released in 1.3.0

@djeedai
Copy link

djeedai commented Dec 18, 2023

Thanks a lot @Lokathor !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XInputGetStateEx?
2 participants