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

Raw input #354

Merged
merged 10 commits into from
Nov 5, 2023
Merged

Raw input #354

merged 10 commits into from
Nov 5, 2023

Conversation

Dregu
Copy link
Collaborator

@Dregu Dregu commented Nov 5, 2023

Tried to figure out more of the input tables.

  • API: Add get_raw_input -> RawInput* to view all pressed keyboard keys and controller buttons without imgui
  • API: ON.PRE/POST_PROCESS_INPUT to disable or capture all input
  • UI: Add player input selector to game props

Comment on lines 103 to 107
bool enabled;
uint8_t padding1[3];
int8_t input_index;
uint8_t padding2[3];
uint32_t buttons;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The struct is
4x bool
int8 input_index
//probably padding
int32 buttons
int8 unknown

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first bool is disabled not enabled
second one is like enabled or something (setting false disables it)
dunno about third
fourth is "connected" - if set to false you get popup about controller disconnected

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, third one is like "can_use_menu"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah I figured there must be more of them, but didn't actually even test what the first one does. The controllers kept getting reserved, not being able to switch to again, even though not set in any input_index, and some of these is probably why

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last byte is used as first parameter to XInputSetState, at least for the XInput controllers

Copy link
Contributor

@Mr-Auto Mr-Auto Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first bool is disabled not enabled
second one is like enabled or something (setting false disables it)
dunno about third
fourth is "connected" - if set to false you get popup about controller disconnected

these didn't make any sense after all, everything you said seems backwards

the fourth i made mistake it's more like "lost_connection" the rest should be correct, so by default you have:

false
true
true
false

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for keyboard those are not default

Copy link
Contributor

@Mr-Auto Mr-Auto Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess we're wrong about the first two (what they mean), and keyboard doesn't seam to care about the menu one
or the struct are different for keyboard vs controller

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever, not really even smart to expose that struct to the api...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also the struct is much larger, seen accessed qword at offset 0x280

@Dregu
Copy link
Collaborator Author

Dregu commented Nov 5, 2023

This is still in a bit of a weird state, but I think I'll merge it cause I may have merged even dumber stuff earlier and this fixes some of that.

@Dregu Dregu marked this pull request as ready for review November 5, 2023 13:30
@Dregu Dregu merged commit 480bd32 into main Nov 5, 2023
10 checks passed
@Dregu Dregu deleted the RawInput branch November 10, 2023 14:23
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.

2 participants