Enhanced Input screen-edge mouse scrolling

+           hello              +

I’m migrating from Legacy input system to Enhanced Input System and have an issue.
Maybe someone is already migrate, and can help me.
I have a screen-edge scrolling logic in my top-down moba game, and it works perfectly fine with Legacy input system.

Now i remake it for Enhanced Input system.
Everything migrates perfectly, zoom, camera focus, mouse-click movement, other key-button inputs, i just replace Legacy input event with EIA event, make IA assets, context bindings, and all is fine. But not the screen-edge scrolling.

When i replace screen-edge scrolling Legacy input event Mouse X with Enhanced Input event, screen-edge scrolling works only when any mouse button is holding down, and cursor is moving parallel to this screen edge, in the perceptive zone.

I dunno how its happened and how to fix it.
Searching through all settings and web about 2 days.
I’m not using any triggers at Input Action and Input Mapping Context Assets.
Trying to use different settings for Scalar and Negate Modifiers, but results is always the same.

Looks like a bug.

Any ideas?

2 Likes

If you look in the new 3rd person character, this node ( with it’s associated definitions ) seems to do the same thing as MouseX

image

U provide a screenshot of an EIA node of Value type Axis2D (Vector 2D) with splatted pins.
This node is identical
image

Right, but I this is different?

image

This is another part of Enhanced Input Action system, Input Action Asset.
Of course, i have this kind of asset for my EIA bindings.
The only difference is the name.

OK, strange, because it works exactly the same as MouseX for me… :thinking:

i’m not sure u read my case correctly.

I see it in this perspective:

MouseX is just an event, when mouse cursor is moving horizontally.
Legacy Input node, which is referred to this event, create a predictable outcome, as blueprint’s logic provide.
But, Enhanced Input node for same event creates a different outcome.
Looks like a container, which new EIA node is, has a hidden settings.

I also have problems with the Enhanced Input Mouse XY Event, it has completely different behavior than the old Mouse X / Y Event.
Have you found a fix yet?

1 Like

not yet, still using Legacy input events for edge-scrolling

Idk if this is the correct way to do this, but might be a workaround if what you are after is to limit the code to the components tick:

// .h
UFUNCTION(BlueprintImplementableEvent)
    void EI_MouseXY();
// .cpp
EnhancedInputComponent->BindAction(MouseXY, ETriggerEvent::None, this, &AMyPlayerController::EI_MouseXY);

I’ll appreciate if someone would correct me or has an alternative.

1 Like

I used enhanced input for edge scrolling. But i didnt use the mouse as a trigger. I used on tick.

Before anyone howls about on tick bad. Its not bad, use it wisely and its fine. Its a quick check of bounds moves the camera if its in any of the four screen bounds i set.

I will check later about enhanced input xy not trigering as i never had that issue but i may have used the 2 seperate mouse x and mouse y actions? Im not at my desktop for an hour but i will look. And in theory it should work off trigger as most actions continuoulsy trigger on use but the mouse is a different beast and may us ongoing? I will check

If you already have the enhance input ticking: why not use it rather than also the actors tick? :innocent:

It was just the way i decided at the time, and as you have pointed out, its not working right? But it was just how i did it, i needed delta seconds for rotation speed so used that.

Yes i know i can get worlddeltaseconds but it was simple enough just to use on tick.

To be honest i never considered the mouse movement just didnt come into my head , go figure, but if it works when i test later maybe i will as it does make sense optimisation wise, but i doubt on tick for a simple piece of code is going to harm my fps

I can confirm that the mouse x mouse y and mousexy (2dAxis) only work during key button presses at my end too. Infact LMB down returns movement LMB up stops it. RMB click or click and hold makes all movement show until i LMB click.

Seems this is linked to the mouse buttons and not a continuous stream as would be expected from say a thumb stick.

guessing my on tick method is looking good right now no? :rofl:

strange behaviour

This seems to work, but with this method, it only executes if left and right mouse buttons are not pressed.
As soon as i press the left or right mouse button it only executs every now and then, and only when moving the mouse a lot.
But i can imagine this is happening because of some Capture setting.

i just use ontick and capture the mouse viewport position. I dont take any inputs from the mouse directly. so i have no issues with the scrolling that way.

1 Like

Sounds like you added the function to your already created inputs. If you did, try creating a new input with MouseXY (vector2d). Others inputs shouldn’t trigger it.

ETriggerEvent::None seems to be the “up state” of inputs but its not exposed to bp.

Aloha!

Use “Set input mode game only” before and your trigger will work fine.

ty for participating, mate, but its dont work for me
its even worse, bcz i need input mode Game and UI
image

5.3 preview, still using legacy input for this

Hi there! I’ve been doing some testing on my own end, and I can get the Mouse XY 2D-Axis Input Mapping Context to translate to an Axis 2D (Vector 2D) Input Action without holding the mouse button down if and only if Show Mouse Cursor in the Player Controller is OFF. For some reason, when bShowMouseCursor is true, it seems to block automatically registering the mouse into the game window. You have to hold down a mouse button when this is true.

I believe that, under the hood, this boolean is giving the same behaviour as the default “Shift+F1 to detach mouse” functionality when the game window does capture the mouse i.e. it’s not just showing the cursor like it suggests, but actively de-registering it from the game window so it’s essentially not-interacting with your game until you click into the window. If this is true, the boolean is a bit of a misnomer.

Not sure if that is the problem you were running into? Feels like buggy behaviour to me.

3 Likes