Common ui - trouble getting back handler action to register in 4.27

anybody using common ui in 427 and have the back handler action working correctly?

i cant get it to register. I’ve followed both the two hour livestream and the docs quick start guide - gone over everything to see if i missed any steps and can’t find anything wrong.

I dont have to add input action/axis in project settings > input, right? That is all handled in the CommonInputActionDataBase data table?

Normal navigation is all working as expected. No problem with any communications getting through. Just this OnHandleBackAction function wont fire:


even if i enable IsBackHandler:
image

Did you ever find a solution to this? I’m having the same problem.

No, I have been using my own system for it.

I just read inputs in OnKeyDown and fire off my own event which removes the topmost widget from the stack.

I imagine that is same thing common UI does but I can’t figure out how to actually make it work. There is quite a few things in CommonUI that I can’t get to work as advertised, but in most cases the basic idea wasn’t difficult to reimplement on my own with blueprints.

1 Like

I’m about to give up my efforts as well and use the same method. The on key down is how I had my menus set up prior to commonUI but I was hoping to get the back handler to work. I can’t seem to get the action bar to work either.

I suppose you have a UI Base widget which contains the stack/s where you push your Common Activatable Widgets to. Is this base widget a Common User Widget or a Common Activatable Widget?

I created the base widget as an Activatable Widget and triggering actions wouldn’t be registered unless auto activate was checked. I have now changed the base widget to inherit from CommonUserWidget instead and this problem seems to be solved!
Hope this helps.

3 Likes

I have a base widget derived from CommonActivatable that host the widget stack which I push to. And it has to be activated for for things to work.

I’ll give what you suggested a shot, thanks for sharing

1 Like

I ran into this issue myself while migrating to common UI. I looked into it and found that the routing never gets set up as the UCommonGameViewportClient constructor for serialization is never called. My solution was to simply add a default constructor that did the exact same thing as the serialization constructor.

CommonGameViewportClient.h:

UCommonGameViewportClient();
UCommonGameViewportClient(FVTableHelper& Helper);
virtual ~UCommonGameViewportClient();

CommonGameViewportClient.cpp:

UCommonGameViewportClient::UCommonGameViewportClient() : Super()
{
	OnRerouteInput().BindUObject(this, &UCommonGameViewportClient::HandleRerouteInput);
	OnRerouteAxis().BindUObject(this, &UCommonGameViewportClient::HandleRerouteAxis);
	OnRerouteTouch().BindUObject(this, &UCommonGameViewportClient::HandleRerouteTouch);
}

UCommonGameViewportClient::UCommonGameViewportClient(FVTableHelper& Helper) : Super(Helper)
{
	OnRerouteInput().BindUObject(this, &UCommonGameViewportClient::HandleRerouteInput);
	OnRerouteAxis().BindUObject(this, &UCommonGameViewportClient::HandleRerouteAxis);
	OnRerouteTouch().BindUObject(this, &UCommonGameViewportClient::HandleRerouteTouch);
}
1 Like

I can also confirm @Racso25 solution works out for me/

  • Base UI Widget is UCommonActivatableWidget
  • Children stackable widgets are inherited from UCommonActivatableWidget
    2 things to do in order for back action to be handled correctly :
    => Set bIsBackHandler = true in the stackable classes
    => Set bAutoActivate = true in my BaseUI UCommonActivatableWidget

None of this works for me. Back handler never gets called no matter what I do. I tried changing the constructor of UCommonGameViewportClient. I tried adding custom CommonUI button widgets with an input action. Nada. Nothing works.

I just found something really really weird. There are three checkboxes in Project Settings, Common Input Settings. They are called:

  • Allow Out of Focus Device Input
  • Enable Default Input Config
  • Enabled Enhanced Input Support

I had the last two checked. I then checked the first one and different input actions started working. But the back handler also started working.

I unchecked it and it still works. So if anyone is having this problem still, maybe try toggling these on and off to get them to reset or something.

I wasted two whole days on this just for a checkbox to fix it. lol

1 Like

thanks for reporting!

yeah stuff like that is why i usually just build my own systems by default these days. In shorter amount of time i can just make things work exactly how i want and know how it all works, rather than spend a week troubleshooting and then being frustrated and burnt out, and still feeling insecure about a system I don’t fully understand.

of course if they wrote some more comprehensive and accessible documentation…

3 Likes

In addition to what has already been said, in Project Settings, don’t forget to set the Game Viewport Client Class to CommonGameViewportClient (in Engine - General Settings) so the inputs are rerouted to UI.

Make sure all parent widtgets and especiallychild have Auto Activation checked

Try unchecking “Enabled Enhanced Input Support” in the Project Settings > Common Input Settings. That works for me.

I can confirm this, currently in 5.3.2 if “Enabled Enhanced Input Support” is enabled, only “Enhanced Input Back Action” works and “Default Back Action” from data table is completely ignored.

I had the same trouble getting the back handler to register. What worked for me was to subclass UCommonGameViewportClient and add the default constructor like @rickard_ap mentioned above. I also noticed they seem to do something similar in Lyra.

thank you dude…it’s works

Hello everyone !
I’ve made a discover about that issue. I think @rickard_ap solution was a part of the solution for me. It started to work when I implemented an ActionDomainTable on the ComminUI_Settings.

So for those who were still enable to make it work, try that !



Just to put out there if you your back handle is not working, maybe you didn’t mark at the Ativatable Widget the option to handle it.

image

I have checked [IsModal] and it works now.