Mappable Key widget array, detecting already mapped keys

I’m having a bit of a headscratcher here with a widget for mapping keys in the settings menu that I can’t seem to figure out (or maybe it’s just not doable, idk).

The entire point of what I’m doing is having it be dynamic so to speak, I don’t want to be forced to manually create a widget for each key mapping, I want the widget to just read the IMC and be like “Ah, I have this amount of mappings, and they are named this, and these are the keys mapped to those actions” and create all required child key mapping slot widgets with their respective information from that IMC.

So short rundown of what I’ve got right now, and what doesn’t work.

I’m using Enhanced Input. I’ve set up a Input Mapping Context with all IA’s inside using the Player Mappable Key Settings option, and I’ve also given all the IA’s different Display Categories (so all IA’s related to movement have the category “Movement” and so on).

I’ve also got a set of secondary key mappings (e.g: W for Primary “Move Forward”, and Up Arrow for secondary “Move Forward”), and those IA’s are named Main category (like movement) + Secondary.

The settings widget has a widget switcher that gets populated at runtime, and one of the things it gets populated with is the “Controls” widget.

The Controls widget starts of by taking in the IMC and goes through all mappings in a loop, adding all PRIMARY categories into an array.

Once that’s done, I have another loop going through the categories array, firstly creating a header (Movement, Look, Weapons and so on) and after that it picks out all mappings that matches that category and creates a key binding slot widget for each mapping, with 2 player mappable keys in (1 primary and 1 secondary) and passes the Key Mapping Structure from the loop onto that widget, and when its done with that category it proceeds to the next and repeats. Each time a key binding slot widget is created I add it to a widget slot array to be able to reference it later (idk if it’s doable any other way, since it’s created at runtime?).

Once all mappings have gotten their key binding slot widgets set up, I use the array of widget slots in a loop and pass the widget slot array itself into each key slot widget, so each slot can “see” all other slots that got created.

Now, when remapping a key, the slot that is doing the remapping loops through the widget slot array that it was passed right after being created and looks at the Key Mapping Structure > Key in each entry, comparing it to the key that the slot is trying to map, to see if that key is currently mapped to any other action. This I have functioning as intended, it shows a popup with “Hey, key is already mapped to the primary/secondary slot for the action action, do you want to replace it?” if it detects a duplicate mapping somewhere.

But my problem here is, how do I update the information in the widget slot array once an IA is remapped to a different key? Because every time one of the widget slots reads the widget slot array to look for duplicates of a mapping, they always read out the information that was in the array when the widgets were created. I think it would be most logical to have the array get updated in the controls widget and then passed onto each slot instead of having each slot independently update their own version of the array, and I think I’m good with how to pass an updated array to each individual slot widget once I’ve updated it with new information, but it’s just that part of getting the new information into the array…

How do I update that information? Is it even possible to do?

I don’t know if I worded this perfectly (probably not, English is not my main language and I’m still kinda fresh to this so, it is what it is), but if someone is willing to try and help it would be greatly appreciated. If I’m unclear about something just tell me and I’ll try and describe it better.

Just please help, I’m about to get a stroke from this