what are all the key names in keyboard module?
Question:
In the python keyboard module https://pypi.org/project/keyboard/ what are all the names of the keys? can anybody give me a list of it because I can’t find one.
Answers:
keyboard
doesn’t have such a list in the docs, or even in the source code. keyboard
builds its key information tables at runtime by querying key information from Windows APIs or from dumpkeys
, then applying a bit of its own postprocessing.
The key information tables keyboard
builds aren’t anywhere in its public API, but if you import keyboard
, the private keyboard._os_keyboard.from_name
table should have all of keyboard
‘s canonical key names. keyboard._canonical_names.canonical_names
should have the mapping from non-canonical names to canonical names, if you want that info too, but I’m not sure everything in that table is actually guaranteed to be a supported key.
In the python keyboard module https://pypi.org/project/keyboard/ what are all the names of the keys? can anybody give me a list of it because I can’t find one.
keyboard
doesn’t have such a list in the docs, or even in the source code. keyboard
builds its key information tables at runtime by querying key information from Windows APIs or from dumpkeys
, then applying a bit of its own postprocessing.
The key information tables keyboard
builds aren’t anywhere in its public API, but if you import keyboard
, the private keyboard._os_keyboard.from_name
table should have all of keyboard
‘s canonical key names. keyboard._canonical_names.canonical_names
should have the mapping from non-canonical names to canonical names, if you want that info too, but I’m not sure everything in that table is actually guaranteed to be a supported key.