Blueprints for using hold+spacebar for seamless upward flight

I’m a noob and I really need a rundown of a blueprint layout that will make it so that my char can use spacebar as essentially the jumping, switching to flying mode and flying up key, while automatically switching back to running/walking normally when getting back on the ground. It would also be helpful if someone could explain to me how to even build a hold+key input so that I can differentiate between a jump (which i would like to just be a tap of spacebar) and switching to flight mode directly from the ground which I would like to be holding the spacebar down with no delay and going directly up.