Are there any known issues with using Mouse Wheel Up and Mouse Wheel Down as an Input Axis Mapping?

Are there any known issues with using Mouse Wheel Up and Mouse Wheel Down as an Input Axis Mapping?
If I change the axis mapping to use some keyboard input instead, then my blueprint works fine. But I’m not getting any InputAxis events when I map it to Mouse Wheel Up and Mouse Wheel Down.

I’ve made a temporary workaround using Mouse events instead, but I would like to remove that.

I also have this workaround in my Game, looking forward for an Answer!

Mapping the mousewheel up/down keys to an axis doesn’t work because the key is considered to have been pressed and released within the same frame and so when the Axis evaulates its total value it doesn’t see the Key as being down and so it makes no contribution to the axis value.

We could consider adding (or using the MouseWheelSpin I just removed…) an axis key that provides an analog value each frame and frames in which a mousewheel event occurred it would return 1 or -1 depending on the direction and the rest of the time it returns 0, but I think that the mouse wheel doesn’t really map well to the idea of axis in which the stick/button is held.

Under Project Settings → Input → Axis Mappings, the Mouse Wheel Up and Mouse Wheel Down don’t work as Axis Mappings.
FYI I’m using InputComponent->BindAxis and everything except the mouse wheel fires the event with a value != 0.0f

The WM_MOUSEWHEEL: message is sent to FGenericApplicationMessageHandler::OnMouseWheel(float) But I don’t know enough about the engine to figure out how that maps into the InputComponent

I wish I had time to debug this in the engine code.

Update: I changed the binding from Axis to two different Action maps. And the Action maps work.

I’ve got as far as finding the slate panel FInputAxisMappingCustomization::CustomizeChildren which sets up the key bindings to a FInputAxisKeyMapping. But I’m unsure how it enumerates over the list of possible keys. I’m trying to find out where to remove ‘Mouse Wheel Up’ and ‘Mouse Wheel Down’, but haven’t figured it out yet because I don’t know much about slate or the input system.

I came up with this solution and works smoothly for me. Might want to add some clamps to restrict your FOV range. :slight_smile:

For anyone else having this same problem, in Unreal Engine Editor you’d go into Edit/Project Settings/Input

Then set your Bindings for the Action Mapping of MouseWheelUp and MouseWheelDown like this:

Then in a blueprint you can test this out like this:

40303-mousewheel+up+and+down.jpg

It should look like this when it’s working:

Then if you want to use it for something such as zoom in and zoom out with a number of zoom levels you could simply add some logic to increment and decrement a variable that stores the mouse wheel value, you could optionally clamp the value to a range, or set for numbers to handle set levels of zoom based on a count with the increment and decrement or a reset to the first zoom level upon going under or over a specific Min and Max Zoom level when you’re rolling the mouse wheel up or down.

Have you ever resolved this problem?

No, since it’s working just as intended (read Marc Andy’s answer). So one need to use Action Mappings instead of Axis Mappings. That means that I solved my use case, but this question was about Axis Mappings for the scroll wheel.