-
Notifications
You must be signed in to change notification settings - Fork 0
/
KeyInsert.py
87 lines (64 loc) · 2.83 KB
/
KeyInsert.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import pyautogui as auto
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
import time
TITLE="KeyInsert"
COUNTER = "Click Submit to start countdown"
def writez(text, targetFrame):
print(text)
timer = 3
count = timer
while count != 0:
if targetFrame != None:
targetFrame.config(text="{}".format(count))
print("Countdown: {}".format(count))
main.update()
time.sleep(1)
count -= 1
auto.typewrite(text, interval=0.1)
print(text, "has been written")
if targetFrame != None:
targetFrame.config(text="Text has been written")
def main():
resp = auto.confirm("What would you like to paste?\n[*] They are both funtionally the same. Just the multiline is nicer on the eyes", buttons=['Single Line', 'Multi Line',], title=TITLE)
if resp == "Multi Line":
root = tk.Tk()
root.title(TITLE)
frame_a = tk.Frame()
entry = tk.Entry(master=frame_a, width=50)
label_a = tk.Label(master=frame_a, text="Hey! This is the Multi lined KeyLogger Program!\n\nPlease insert the text you want to paste below\n\n")
label_a.pack()
entry.pack()
ttk.Label(root, text="Hey! This is the Single lined KeyLogger Program!\n\nPlease insert the text you want to paste below\n\n",
font=("Times New Roman", 15)).grid(column=0, row=0)
ttk.Label(root, text=COUNTER, font=("Bold", 12)).grid(column=0, row=1)
ttk.Label(root, text="Text to Paste:", font=("Bold", 12)).grid(column=0, row=2)
ttk.Label(frame_a, text="Test")
text_area = scrolledtext.ScrolledText(root, wrap=tk.WORD,
width=40, height=8,
font=("Times New Roman", 15))
sub_btn=tk.Button(root,text = 'Submit', command = lambda: writez(text_area.get("1.0", "end-1c"), None))
text_area.grid(column=0, row=2, pady=10, padx=10)
sub_btn.grid(column=0, row=3, pady=10, padx=10)
# placing cursor in text area
text_area.focus()
root.mainloop()
if resp == "Single Line":
window = tk.Tk()
window.title(TITLE)
frame_a = tk.Frame()
frame_b = tk.Frame()
entry = tk.Entry(master=frame_a, width=50)
label_a = tk.Label(master=frame_a, text="Hey! This is the Single lined KeyLogger Program!\n\nPlease insert the text you want to paste below\n")
frameC = tk.Label(master=frame_a, text=COUNTER)
button = tk.Button(master=frame_b, text="Submit", command=lambda: writez(entry.get(), frameC))
label_a.pack()
frameC.pack()
entry.pack()
button.pack()
frame_a.pack()
frame_b.pack()
window.mainloop()
if __name__ == '__main__':
main()