Query Keys Mapped to action array is empty (even after message)

I think it’s self explanatory. I’m trying to retrieve the keys mapped to an action and get the Device Identifier to show the interface depending on Input device type. I implemented it already with binding my event to On Input Hardware Device Changed and it’s working. If i switch from KBM to gamepad it reflects the change and with the right key, but i try to initialize on construction because the UI doesn’t update automatically on start, and i’m getting an empty array of mapped keys even if I know it’s mapped and it works fine on update if i swap device.


Captura de pantalla 2024-12-13 232527

I was having the problem of “Query Keys Mapped to Action” returning an array with length 0, and was frustrated by the lack of answers online, so I wanted to share the solution I found.

I was setting the mapping context and using the “query keys mapped” function at the same time without realizing it. There must be a delay between setting the mapping context and calling the query function. I’m not sure why, since mapping contexts which haven’t even been added don’t have this problem. But adding a mapping context and calling the function simultaneously (or too quickly) will give an empty array.