Detect which key was used for input (gamepad or keyboard)

Just don’t attach anything to the gamepad button release event? You could have it click on and click off with just a branch node like this.