On a standard computer keyboard there are 12 function buttons: f1 - f12. Looking through the files for pynput.keyboard
there are 20 available function buttons to use under pynput.keyboard.Key
, as shown:
# A block of code from the pynput/keyboard/_win32.py file
f1 = KeyCode.from_vk(VK.F1)
f2 = KeyCode.from_vk(VK.F2)
f3 = KeyCode.from_vk(VK.F3)
f4 = KeyCode.from_vk(VK.F4)
f5 = KeyCode.from_vk(VK.F5)
f6 = KeyCode.from_vk(VK.F6)
f7 = KeyCode.from_vk(VK.F7)
f8 = KeyCode.from_vk(VK.F8)
f9 = KeyCode.from_vk(VK.F9)
f10 = KeyCode.from_vk(VK.F10)
f11 = KeyCode.from_vk(VK.F11)
f12 = KeyCode.from_vk(VK.F12)
f13 = KeyCode.from_vk(VK.F13)
f14 = KeyCode.from_vk(VK.F14)
f15 = KeyCode.from_vk(VK.F15)
f16 = KeyCode.from_vk(VK.F16)
f17 = KeyCode.from_vk(VK.F17)
f18 = KeyCode.from_vk(VK.F18)
f19 = KeyCode.from_vk(VK.F19)
f20 = KeyCode.from_vk(VK.F20)
What I want to know is, what do the functions > 12 do, and what use do they have now (as they are not on the standard keyboard).
Hey so some keyboards have more f keys, some go up to 20 and in the old days the used to go up to 24. My speculation is because on Windows, some software allows you to save shortcuts on up to f24 keys, by using shift + f1 and so on up until 24 (Note: you can use > f12 without any program or software opened, however it does nothing when you use them, except f6 which automatically selects the small corner of the taskbar used to minimize everything and f10 which is used to right click, but this is just normal use of the f keys as well as f6 and f10 rather than using f18 and f22). However this makes no sense as why they would just stop at 20 if that was the case. I am guessing they just got up to 20 and decided that was enough.