Download

[Question] Override some keys when in mode (build screen, walk, crafting) for gamepad and keyboard.

Hi,

Do you know a good way how to partially rebind input keys on gamepad and keyboard? Lets say I have two mods - normal and tool mod. In normal mod, everything is in normal binding (main menu, look up/down movement, jump etc…). In Tool mode. Everything will be same except some keys what are used in normal mode will be partially overriden by the mode to do something different. When returning back, it will be as normal mode. So (A) in normal mode is for Action X but in Tool mode. the (A) is for Action Y and the normal mode won’t receive anything - it will ignore the (A) pressed.

I’m thining about a few solutions:

  1. (USE UMG to determine rebinding) Set Input Mode Game and UI:

    • Works fine but I need to hold mouse button to interact with pawn lookup/down movement. Mouse is released and I want to be in focus. (Do you know how to solve this?)
  2. (USE UMG to determine rebinding) Set Input Mode Game UI:

  • Will have to copy entire normal mode input binding to that UMG because UI only generally ingore every input outside of UMG

In short: I just want to rebind/override some keys when in particular mode for gamepad and keyboard. (building, walking, crafting etc.) Do you know a good workflow how to do it?

Thank you!

The most straight forward approach I can think of is to use events.

The key when pressed checks a branch conditional that determines which actionable event is executed.

Yes. I will be making something like this in order to notify other logic that a switch happened. Thank you for the tip!