I am coding a (key/mouse)logger in python.
I have a fully functioning mouse logger, and a full operating keylogger. Now it is time to merge it. I am using Listener from pynput and I cannot figure out how to make 2 listeners that listens at the same time, also keyboard.Listener(on_press=on_press) and mouse.Listener(on_click=on_click, on_scroll=on_scroll) as listener1:
does not work. I am new to python, so I am probably missing something really simple. Can anyone help me?
Asked
Active
Viewed 115 times
0

Nemo
- 33
- 5
-
Does it answer your question? https://stackoverflow.com/questions/893333/multiple-variables-in-a-with-statement – kosciej16 Apr 18 '22 at 10:06
-
@kosciej16 unfortunately not – Nemo Apr 18 '22 at 10:22
-
And this? https://stackoverflow.com/questions/45973453/using-mouse-and-keyboard-listeners-together-in-python – kosciej16 Apr 18 '22 at 10:24
-
@kosciej16 I implemented multithreading, and now it works. So awsome – Nemo Apr 18 '22 at 11:29