Announcement

Collapse
No announcement yet.

help me! Custom input device error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    help me! Custom input device error

    hi

    i need create a user input device


    https://wiki.unrealengine.com/Custom_Input_Devices
    https://wiki.unrealengine.com/Custom...e_plugin_guide

    I made two links.


    but

    When you map a key, no value is entered.

    GenericInputDevicePlugin.cpp
    void FGenericInputDevice::SendControllerEvents()
    {
    const double CurrentTime = FPlatformTime::Seconds();
    const float CurrentTimeFloat = FPlatformTime::ToSeconds(FPlatformTime::Cycles());

    ControllerState.State = FMath::Sin(CurrentTimeFloat * .223f * 2 * PI);
    MessageHandler->OnControllerAnalog(ControllerState.Axis, ControllerState.ControllerIndex, ControllerState.GetValue());
    FSlateApplication::Get().OnControllerAnalog(ControllerState.Axis, ControllerState.ControllerIndex, ControllerState.GetValue());

    UE_LOG(LogTemp, Warning, TEXT("Sending dummy analog controller event! x:%f , id:%d"), ControllerState.State, ControllerState.ControllerIndex);
    }

    The log message is displayed in the editor log window
    If you create and execute a keystroke in blueprints, the input will not work.

    Click image for larger version

Name:	bb.PNG
Views:	1
Size:	35.9 KB
ID:	1216054
    Click image for larger version

Name:	ccc.PNG
Views:	1
Size:	20.3 KB
ID:	1216055

    #2
    Hi Sir, (can't read that name )

    I had the same problem before, for some reason the player index 0 is always constrained to the keyboard, even if your log displays is OK, the event never call from your custom input inside your blueprint right?, FSlateApplication::Get().OnControllerAnalog is working well at this stage. (if you want check that, add a second player in split screen, your input will reach the second player only)

    In order to fix this I modified a setting inside the project settings, go to Maps & Modes -> Local Multiplayer -> Skip Assigning Gamepad to Player 1, and another super important thing, after modify this setting restart the editor please,
    it was one of the must annoying problem ever!, for me is bad coding practice from epic, (locking functions from no where in another portion of code from no where? OMG!!! ))))
    Last edited by ZkarmaKun; 04-06-2017, 12:59 PM.

    Comment

    Working...
    X