I'm not sure how exactly, it depends on the Laptop make and model, for example Alienware usually have their own app for the keyboard lighting and shortcut keys (aka Fn, Function keys, and F1-F12), I have one myself the app is Alienware Fusion, it has a section for editing shortcut keys etc.

You could reply with the make and model and I might be able to find out how it uses the F1 through F12.

Also you might want to check if the game is running in "Fullscreen" mode or not, that may affect the use of the keys, I think by default the game is set to "Windowed" mode or "Borderless window", both of those modes might cause issues, I would try Fullscreen and see if F1 still closes it, you can check in: Menu > System config > Display > in this window it lists the 3 screen modes.

One more thing, when you look at the F1 key, is there anything on it besides F1, like a small icon of a screen or sun/moon, something etc, if so what icon does it depict?