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.

Asked By: Arnav711

||

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.

Answered By: user2357112
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.