Get Mouse Acceleration, works only when i press a mouse button

Hi all,

this may be some real simple thing, i just could not find out why it is happening.

I did some AxisInput for MouseX and MouseY. I bound that in my PlayerController using BindAxis. Now, i only get the according input when i press and hold a mouse button, otherwise the input is zero.
I also already tried fiddling around with IgnoreLookInput, but this was not really helping.

Any Ideas on that?


Is your goal to get the change in mouse movement in x and y axis?

You can obtain that (without any mouse buttons having been pressed) this way:

//Player Controller Function
//Mouse Dx/dy
FVector2D MouseDelta;
GetInputMouseDelta(MouseDelta.X, MouseDelta.Y);

Hi Rama,

thanks for that function, thats a bit simpler than needing to have inputbindings and stuff around it for that.

Though no matter if i do it with InputBindings or GetInputMouseDelta, i only get values other than zero when i press a mouse button for some reason.

To clarify, this is my (reduced) PlayerController:


#pragma once

#include "GameFramework/Actor.h"
#include "PlayGroundPlayerController.generated.h"

class APlayGroundPlayerController : public APlayerController {

        // Begin PlayerController interface
        virtual void PlayerTick(float DeltaTime) OVERRIDE;
        virtual void SetupInputComponent() OVERRIDE;
        // End PlayerController interface


.cpp (here only the Tick-Function since this already troubles me):

void APlayGroundPlayerController::PlayerTick(float DeltaTime) {

	FVector2D MouseDelta;
	GetInputMouseDelta(MouseDelta.X, MouseDelta.Y);
	if (MouseDelta.X != 0 || MouseDelta.Y != 0) {
		aMouseX = MouseDelta.X;


When i put a Breakpoint on the line aMouseX = MouseDelta.X; then i only get there when i move the Mouse AND press any button.

Any ideas?

Thanks for your help!


I’m gonna look into this in a bit, but in the meantime,

another way to get constant feedback to yourself could be this, onscreen, constantly showing you want is happening, realtime :slight_smile:

FVector2D MouseDelta;
GetInputMouseDelta(MouseDelta.X, MouseDelta.Y);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Mouse Input Delta: %s"), *MouseDelta.ToString()));

That should make things even more obvious :slight_smile:

If you try this, I anticipate it will read all 0s even if you move mouse, until you hold down a button as well?

Can you verify the onscreen version?

Also, not using any conditional statements?


Hi Rama,

thanks for taking the time.

There are no additional conditionals in any way, i already reduced the PlayerTick to what i wrote one post earlier. Of course i already tried logging Debug - Messages, with the same result.

When i got some time again i will try creating a new empty project which just has the logging of the mouse-accel implemented, just to know if its some setting i did (Though i already checked everything, but you can never be really sure :wink: ).

Since it should work for other devs (or otherwise we would have more threads with this topic here), it must be some setting or override anywhere.


Well it certainly works for me!

I use Mouse Delta all the time in my game, without any mouse buttons pressed

I think I’ve heard of this issue before though, but I dont know the solution

will poke around and see if I find anything

Are you setting bShowMouseCursor to true by any chance? If so, maybe its a mouse capture issue?


yeah, i almost forgot about that, since this is in my Character - BaseClass :slight_smile:

So i guess this is the HardwareCursor then, and it doesnt forward the acceleration to the engine itself while not clicking?

I guess this is the perfect opportunity to finally start implementing my Game-UI with a custom mouse-cursor; For now i was pushing it back the whole time :wink: