Well I mean from what I understand if a condition is let’s say true it won’t run the “false” part so the part where you call the event and change the variables would only happen when the controller type changes. The only extra step would be to check every tick if controller is true or if keyboard is true depending on the current controller used.
The ideal would be to apply this to actions mapped and not individual keys because it would take for ever, or maybe there is a way to call an event when a keyboard key is pressed or when a controller button is pressed ? That would surely help a lot.