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

How to use get_glyph_for_action_origin #208

Closed
codingMASTER398 opened this issue Sep 16, 2024 · 5 comments
Closed

How to use get_glyph_for_action_origin #208

codingMASTER398 opened this issue Sep 16, 2024 · 5 comments

Comments

@codingMASTER398
Copy link

Writing this, I'm extremely new to Rust, but I have no clue how you could possibly use get_glyph_for_action_origin in the input API. One of the required parameters is a "EInputActionOrigin", but the enum behind that is private.

How would you interact with this API?

@Noxime
Copy link
Owner

Noxime commented Sep 16, 2024

EInputActionOrigin is public, but it's part of the steamworks-sys crate. You must also include it in your dependencies. I think we should re-export it at crate level for convenience.

steamworks = { git = "https://github.com/Noxime/steamworks-rs" }
steamworks-sys = { git = "https://github.com/Noxime/steamworks-rs" }
use steamworks_sys::EInputActionOrigin;
...
let glyph = input.get_glyph_for_action_origin(EInputActionOrigin::k_EInputActionOrigin_SteamController_A);

@codingMASTER398
Copy link
Author

Thank you so much for the fast response! That really clears things up.

Using the API, how could I possibly get what a user has binded for a specific action (e.g. jump) and get the glyph for it? get_digital_action_data (or any of the other functions I've researched) don't seem to provide anything like that.

@codingMASTER398
Copy link
Author

codingMASTER398 commented Sep 17, 2024

@Noxime I've researched a bit and implementing glyph representation (a requirement for "full" Steam input API usage requires GetAnalogActionOrigins and GetDigitalActionOrigins. I, quite frankly, have no idea how to implement those (despite my many attempts).

I'm attempting to implement these for Steamworks.js. (via napi)

@Noxime
Copy link
Owner

Noxime commented Sep 17, 2024

Hey, quite busy this week and I didn't have time to test it yet, #209 has those functions implemented. How about you give that branch a go and if they work, hit it with a thumbs up?

@codingMASTER398
Copy link
Author

Works. Thank you so much!

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

No branches or pull requests

2 participants