Download

Force a Key/Input Release

I’m trying to force a key release on a certain event, and I can’t quite figure out how to do it. I’m using the “Release Key” function but I don’t know what to reference for the target. It’s asking for a “Widget interaction component”. Does this mean you have to implement the key release inside of a widget? I want to use it inside my pawn.

Also, I was trying to get the specifically mapped input key as opposed to forcing a specific binding (like “D”), but this also doesn’t seem to work:

I get the error: “Blueprint Runtime Error: “Attempted to access index 0 from array CallFunc_GetActionMappingByName_OutMappings of length 0!”. Blueprint: GunnerPawn Function: Execute Ubergraph Gunner Pawn Graph: EventGraph Node: Print String”

If I understand the message correctly, it’s telling me it’s not finding the input mappings. How do you actually use these functions?

You’ll only get stuff in the array from GetActionMappingByName if you have it in the project settings. Just tried it, works fine.

ReleaseKey not too sure about. You certain need to use it in a blueprint widget component, so it might not be what you’re looking for.

I guess you could code your input ‘as if’ the key is no longer down.