How can I make a button/key unable to be pressed?

I have a character the while he is aiming (right mouse button), I don’t wanna be able to switch weapons (keys 1,2,3 and 4). So, when I press the right mouse button, the keys 1,2,3 and 4 are not supposed to work. Is there a way I can config a blueprint to do that? Thanks.

Use a gate node. If you press the mouse button the gate closes key 1,2,3,… on release you open it.

There’s probably many ways: