This module offers a comprehensive solution for handling keyboard input across platforms. Whether you’re detecting simple keypresses or complex key combinations, our get_key function and Keys constants deliver robust functionality with clear, descriptive outputs. Perfect for developers needing to implement precise keyboard interactions in their applications.
You can install keypress via pip:
pip install keypressYou can run keypress in your terminal.
from keypress import Keys, get_key
if __name__ == "__main__":
key = ""
while key not in ["q", Keys.ENTER]:
key = get_key()
if key.is_printable:
print(key)
print(key.key_codes)
print(key.description)Contributions are welcome! Please see our contributing guidelines for more information.
This project is licensed under the MIT License. See the LICENSE file for details.