Hi, if I want to call connection() method when F1 is pressed, what is the correct code?

Thanks