x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Mouse wheel input not working in Axis Mapping?

The input from Mouse Wheel Up/Down doesn't seem to work at all in my PlayerController class. I made it so it constantly prints its value , and the Mouse Wheel Up/Down it's the only case which the input is not received. I tried to -Change the input to keyboard and it worked -Change the input to left/right mouse click and it worked -Have an Action Mapping that print a string everytime the Mouse Wheel is scrolled and it worked -My Mouse's wheel is not broken

here is the code with the different functions

 ARTSPlayerController::ARTSPlayerController()
 {
     bEnableClickEvents = true;
     bShowMouseCursor = true;
     bEnableTouchEvents = true;
 }
 
 void ARTSPlayerController::SetupInputComponent() {
     Super::SetupInputComponent();
     this->InputComponent->BindAction("Move", IE_Pressed,this, &ARTSPlayerController::Move);
     this->InputComponent->BindAxis("Wheel", this, &ARTSPlayerController::Wheel);
 
 }
 
 void ARTSPlayerController::Move() {
 
     if (GEngine) {
         GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("found"));
     }
 }
 
 void ARTSPlayerController::Wheel(float Value) {
 
     if (GEngine) {
         GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("value: %f"),Value));
     }
 
 }


And it just prints 0.00000 even when i scroll up or down w

Product Version: Not Selected
Tags:
more ▼

asked Oct 26 '18 at 08:41 PM in C++ Programming

avatar image

Ale1221
3 1 4

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

I just found out that it's all working as intended : it's not possible to assign the mouse wheel scrolling action to a regular axis mapping as you would do with two different keys.

more ▼

answered Oct 30 '18 at 04:59 PM

avatar image

Ale1221
3 1 4

(comments are locked)
10|2000 characters needed characters left

Try this in the Input project settings

alt text

more ▼

answered Oct 27 '18 at 01:25 AM

avatar image

Ali Akbar
676 2 5 8

avatar image eriksnoww Oct 30 '18 at 04:26 AM

I believe we want the Mouse Wheel Axis = 1.0 because of "when I scroll up or down" from the OP.

(comments are locked)
10|2000 characters needed characters left

The code is set up correctly, make sure you have your project settings updated.

Edit -> Project Settings -> Engine -> Input

  1. Add to Axis Mappings

  2. Name as "Wheel"

  3. Mouse Wheel Axis = 1.0

I just tested your code with this settings and it worked.

more ▼

answered Oct 30 '18 at 04:24 AM

avatar image

eriksnoww
56 3 3

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question