Announcement

Collapse
No announcement yet.

Char / FString to FKey

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

    Char / FString to FKey

    Hey,


    the player can assign different keys for dynamic actions and therefore I designed a UI where all possible bindings are displayed. In a textbox he should be able to Select / type a key. Now I need to convert the String from the Text-Field to a FKey. How do I do that?


    Thanks


    Freelancer for UE4 and more! www.mykoncodes.com

    #2
    In Blueprint? You'll have to create a switch on string that performs different functions based on what the string is. Sorry, but that's all you got without C++
    iTween For UE4
    Procedural pathed animation for actors, components & UMG - $0
    Runtime DataTable
    DataTables dynamically loaded from text or Google Sheets while your game is running!
    easyCSV
    Fast, cheap, and accurate CSV parsing at runtime!

    Comment


      #3
      It is possible to override OnKeyDown in UMG and get the key that was pressed with GetKey, though I think it won't work if the text box has focus

      Comment


        #4
        I just solved by saving the keys as a string in the objects, and when a key is pressed I redirect the key to the specific object and get the "Get Display Name" and perform a String-Comparsion. Work's so I am happy with it. Thanks for your answer anyways

        But no, hasn't to be in blueprints. I only do certain stuff in BP, most things in C++. If you have a cleaner solution let me know about it


        Freelancer for UE4 and more! www.mykoncodes.com

        Comment

        Working...
        X