Lance3D
(Lance3D)
December 25, 2022, 4:13am
1
I am using UE5.1 to play with lyra and pixel streaming. Mouse look dose not work, the touch interface does not work too. Is this a bug in lyra UI or pixel streaming?
3 Likes
Lance3D
(Lance3D)
December 25, 2022, 3:54pm
3
Have you tried lyra with pixel streaming? The mouse and touch input does not work in the browser in my case.
xi57
(Xist)
December 25, 2022, 7:49pm
4
Sorry for the confusion. I have not used Pixel Streaming.
Iām only saying that the Lyra inputs work fine in general.
Whatever issue you are seeing must be due to the integration of the two projects.
Lance3D
(Lance3D)
December 26, 2022, 5:02am
5
This seems to be UE5.1 only problem. The UE5.0 version of lyra works with pixel streaming as expected.
2 Likes
Same problem. ue5.1 working with pixel streaming, but Lyra project don`t respond a mouse and keyboard.
Any ideas?
1 Like
xi57
(Xist)
February 5, 2023, 3:52pm
7
I just got out of a deep dive on Lyra, Enhanced Input & CommonUI. I am far from an expert, but I believe the input mode may be in conflict between the two projects.
Lyra uses CommonUI which will absolutely take control over the input mode. Maybe the Pixel Streaming plugin also tries to modify input mode, and the two systems are in conflict?
I wrote up a rough procedure for how to take control of the mouse when using CommonUI, perhaps this will help figure out how to solve the Pixel Streaming conflict.
opened 03:11AM - 30 Jan 23 UTC
tutorial request
As of UE 5.1, this code implicitly changes the input mode to Menu:
```c++
Playā¦ erController->SetShowMouseCursor(true);
```
And this code does not change the input mode at all:
```c++
PlayerController->SetShowMouseCursor(false);
```
This means any time I want to show/hide the mouse as a part of normal game play I need to explicitly manage the input mode and mouse capture settings every time the mouse visibility changes.
Note it's possible the forced switch only occurs if you start off in `Game` only input mode. For certain it happened to me from `Game` mode, it kept forcing me into `Menu` just from making the mouse visible.
In my case, I'm trying to use a widget that is on `UI.Layer.Game` that is sometimes active and sometimes not active. I do not want all the input to stop working for the game, I just want the user to be able to click a widget if they want to, or not click it, with a sometimes visible mouse cursor during normal gameplay.
Ultimately I solved the problem by overriding `ULyraHUDLayout::GetDesiredInputConfig` such that it returns a different config for when I want the mouse to be visible during gameplay compared to what it returns when I want the mouse to be invisible. (Also explicitly disable `bIsFocusable` for the HUD Layout, or it sometimes starts stealing input(?)).
This also required overriding the base `ULyraActivatableWidget::GetDesiredInputConfig` to manage look input ignore settings in the various scenarios since Lyra provides no visibility into or access to set look input ignore preferences.
Finally, a complete and total overhaul of `UCommonUIActionRouterBase::ApplyUIInputConfig` was required, I literally had to throw out that entire method and rewrite it all to get it to work. Part of that included not completely ignoring look/move input ignore preferences like it does by default. (In 5.1 this requires a custom engine, in 5.2 the Launcher Engine will support this by default).
With all of this in place, I had to write a virtual `PlayerController->SetShowMouseCursor` (which itself is not virtual) and any time I want to show or hide the mouse in my extended `SetShowMouseCursor` I also explicitly call my (hacked to be public) overridden Action Router `ApplyUIInputConfig` with the appropriate config for a visible mouse (or invisible as the case may now be).
For all of this to work, the HUD and the C++ need to agree that the appropriate Input Mode is `All` (Game+Menu). And the mouse capture in my case was `CapturePermanently_IncludingInitialMouseDown` with an invisible mouse, and `CaptureDuringMouseDown` with a visible mouse.
Furthermore, since I use the mouse for Look input, I disable Look when the mouse cursor is visible, though Move is still active.
---
Additional reading related to `Game` capture and mouse weirdness:
https://forums.unrealengine.com/t/why-axis-value-of-moveforward-event-is-0-when-left-mouse-button-event/577686/5?u=xi57
1 Like
Thnx, this is interesting. I go to try.
About commonUI, Lyra with UE5.0 work fine with PixelStreaming.
I also tried for test old input system with 5.1 v lyra, but no result
Yes! It actually worked, after a cosmetic fix
Hi there,
Thank you for highlighting the issue and apologies for the delayed reply.
This issue has been fixed on the engine side, so the fix will be implemented in 5.2. Details are in this commit.