i might be a little confused. how do i call this pressed function?

where do i place "if (Key_P)" to make the function be called once the P key is hit and off again when pressed a second time?

thanks again