No announcement yet.

Disable input for every key except one.

  • Filter
  • Time
  • Show
Clear All
new posts

    Disable input for every key except one.

    Hello, I want to ask how can i disable all keys except (in my case) "W" key. I want to enable only W key for a couple of seconds then disable all except "T" key.
    In other words disable all input except one key.

    Either enumerator that says which key is enabled, or bunch of boolean variables. Then you is if enumerator == "W enabled" or you just check if boolean variable (for eg. IsWEnabled) is TRUE.

    Generally variables (that you set to some values) then checking if variable has right value then deciding with branch if you let or not execution to go trough


      One way you could do that is having an extra Actor that only has the W Key in it.
      When you want the W key active only, you would call "Disable Input" on the actors that currently have Input (probably Character/PlayerController),
      spawn this custom W Actor and enable input on him.

      That Actor would do what ever you want him to do and after x seconds you destroy him again and enable input on your regular Actors.
      Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

      My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
      (Including 100+ Pages Multiplayer Network Compendium to get you started.)