Having To Double-Tap "Action Keys"

Let me just start by saying, I’m actually not sure what these keys all called but I am referring to the Shift, Ctrl, and Alt keys.

So, in my game I have it setup so that any of these keys being pressed will result in updating the control modules with the key state, for the sake of detecting a key press in combination with a mouse click. However, these keys always, without fail, have to be pumped twice before they will work.

I have setup [Print String] nodes for debugging purposes and here are the results:

  • Pressing one of the aforementioned keys will result in all of the modules correctly receiving the update broadcast
  • Pressing a mouse button and checking within the module for the key press will result in False
  • Pumping the key again and then clicking once more will result in True

This is by far an undesired outcome. I have done extensive googling and checking with other projects. I went as far as to purchase other games made using Unreal Engine 4 and the results were always the same: at some point, in which holding one of those keys is vital for the desired action in the game, a double-pump was required before it would work.

The results were the same regardless of which operating system was used. The results were also unaffected by using completely different hardware.

One of the main examples I will share is that while playing Sanctum 2, I have to pump the shift key twice before it will properly sprint. I do not believe there is much merit is posting more examples.

This is not an isolated issue and I have wasted countless hours trying to get around this issue, for the past month+. It’s quite frustrating and I absolutely do not believe it has anything to do with how my blueprints are setup. Thus, I believe it warrants further investigation.

Until it is resolved, I regret to say that I am at a standstill in development.

Thank you for your time.

Hi Zakku,

Sanctum 2 is powered by UE3 not UE4 :wink:

From what you say, it sounds like the keys are not registering the first time you press them.

  • Confirm that you don’t have those keys input nodes anywhere else in the BP, or that they are not set to consume the input exclusively
  • Confirm that the window has focus - try clicking your mouse inside it before you test the keys.

If it still doesn’t work, please post you relevant blueprint sections.

My mistake, about the UE3 bit. I was misinformed. Either way, I’ve tried a number of games in my library and they all behave the same way.

I tried the input node both ways-- one way that has the node multicast the keypress to other interfaces, and one without the consume and trying the shift in multiple places.

I have tried numerous ways with setting input modes and setting focus. Every possible combination I have attempted still results in the need to double-pump the shift key.

The blueprints are quite extensive. For the time being, could you point me in the right direction for why a component would say that a variable was not updated when the very event graph it is using has already confirmed the value of the variable? I triple-checked and it was the same instance ID for the blueprint.

Hello Zakku,

I am having trouble reproducing your issue on our end. I have a couple of questions that will help me narrow down your issue

  1. Can your reproduce this issue in a new project?
  2. If so, could you provide a detailed list of steps so I can reproduce this issue on our end?
  3. Could you provide screenshots of your blueprints and Action mappings related to your issue?

Thanks!

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.