ubuntu switch f1 with functions keys

C++
To toggle F1 .. F12 keys use media functions or to be the "F" keys press Fn + Esc.
Source

Also in C++: