How to obtain reference to a single key from InputAxis in C++?

I’m just starting out and have run into a situation I can’t seem to learn about through Googling, and searching the forum didn’t yield anything specific either.

I have a MoveForward() and MoveRight() function to control my character movement, which both read from the keyboard using two input axes: WS bound to one and AD bound to the other. I guess this is pretty standard stuff.

But what I want to do now, because the lesson I’m following is adding combat, is have a specific attack animation trigger from a montage when I press both the attack button (LMB) and the S key simultaneously. I have no issue with the code to play the attack from the montage… my problem is that I can’t figure out how to obtain a reference to just that one key while it’s part of an axis. All of my key bindings are in SetupPlayerInputComponent(UInputComponent* PlayerInputComponent), so I can’t currently reference PlayerInputComponent from outside that function.

It seems like there should be an easy way to do this, I just haven’t found it yet.

Edit: I did try using GetInputAxisKeyValue(FKey(“S”)), but it returned this warning in the output log:

LogPlayerController: Warning: Request for value of axis key ‘S’ returning 0 as it is not bound on this input component.