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.
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.
Well, if you are curious about some keys, you can just run:
import keyboard
def test(callback):
print(callback.name)
keyboard.hook(test)
keyboard.wait()
Videos
» pip install keyboard
See tty standard module. It allows switching from default line-oriented (cooked) mode into char-oriented (cbreak) mode with tty.setcbreak(sys.stdin). Reading single char from sys.stdin will result into next pressed keyboard key (if it generates code):
import sys
import tty
tty.setcbreak(sys.stdin)
while True:
print ord(sys.stdin.read(1))
Note: solution is Unix (including Linux) only.
Edit: On Windows try msvcrt.getche()/getwche(). /me has nowhere to try...
Edit 2: Utilize win32 low-level console API via ctypes.windll (see example at SO) with ReadConsoleInput function. You should filter out keypresses - e.EventType==KEY_EVENT and look for e.Event.KeyEvent.wVirtualKeyCode value. Example of application (not in Python, just to get an idea) can be found at http://www.benryves.com/tutorials/?t=winconsole&c=4.
Depending on what you are trying to accomplish, perhaps using a library such as pygame would do what you want. Pygame contains more advanced keypress handling than is normally available with Python's standard libraries.