forked from CSEC-NITH/RightMe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTypeNazi.py
executable file
·41 lines (34 loc) · 899 Bytes
/
TypeNazi.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
print("Initialising your app ....... ")
import pyxhook
from autocorrect import spell
import pyautogui
import enchant
word = ""
new_hook = pyxhook.HookManager()
def printCorrect(word):
word_new = spell(word)
if word_new != word:
for i in word:
pyautogui.press("backspace")
pyautogui.press("backspace")
pyautogui.typewrite(word_new + " ")
def OnKeyPress(event):
global word
global new_hook
if event.Ascii == 96:
new_hook.cancel()
if (event.Ascii >= 65 and event.Ascii <= 90) or (
event.Ascii >= 97 and event.Ascii <= 122
):
word += event.Key
if event.Ascii == 32:
printCorrect(word)
word = ""
def main():
global new_hook
# listen to all keystrokes
new_hook.KeyDown = OnKeyPress
# hook the keyboard
new_hook.HookKeyboard()
# start the session
new_hook.start()