Enhanced Input not working if widget pushed - barsandcat/HMS-Sunflower GitHub Wiki
Issue was:
Spawning common UI widget manually avoids its prober initialization with common UI. If you push widget to the stack, it goes via widget pool, that call RebuildWdiget. This makes sure that activatable widget applies FUInputConifg when activated (FActivatableTreeRoot::ApplyLeafmostNodeConfig).
Because Input conifg is not set, and bEnableDefaultInputConfig
was true, it returns NULL conifg, which disables mouse capture for viewport.
And that is the reason why viewport was not considered as bProcessInputPrimary
and player input did not process anything.
Why when we add widget to viewport, it does not trigger FActivatableTreeRoot::ApplyLeafmostNodeConfig? Because when we create widget manually, it does not go through widget pool, and does not call RebuildWidget. Essentially, if you are using common ui, you should only use push widget?