Custom animation with key input

how can I make a custom parkour flip if he presses space whilst the character is in mid-air?