Created
October 28, 2019 08:45
-
-
Save ShivamJoker/1f1aa73aaea7fde55b8b0eb2fc4b94f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path.append('..') | |
import keyboard | |
def print_pressed_keys(e): | |
line = ', '.join(str(code) for code in keyboard._pressed_events) | |
# '\r' and end='' overwrites the previous line. | |
# ' '*40 prints 40 spaces at the end to ensure the previous line is cleared. | |
print('\r' + line + ' '*40, end='') | |
keyboard.hook(print_pressed_keys) | |
keyboard.wait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment