remove keys flag remove, doesnt work anyway
This commit is contained in:
12
src/run.py
12
src/run.py
@@ -5,8 +5,6 @@ import os
|
||||
from config import Config
|
||||
from utils.color_checker import run_color_checker
|
||||
from version import __version__
|
||||
from utils.remove_key_flags import remove_key_flags, LPMSG, TranslateMessage, DispatchMessage, GetMessage
|
||||
from utils.remove_mouse_flags import remove_mouse_flag
|
||||
from utils.auto_settings import adjust_settings
|
||||
import threading
|
||||
from beautifultable import BeautifulTable
|
||||
@@ -21,17 +19,8 @@ def start_bot():
|
||||
except KeyboardInterrupt:
|
||||
Logger.info('Exit (ctrl+c)') or exit()
|
||||
|
||||
def remove_flags():
|
||||
remove_key_flags()
|
||||
remove_mouse_flag()
|
||||
msg = LPMSG()
|
||||
while not GetMessage(msg, 0, 0, 0):
|
||||
TranslateMessage(msg)
|
||||
DispatchMessage(msg)
|
||||
|
||||
if __name__ == "__main__":
|
||||
remove_flags_thread = threading.Thread(target=remove_flags)
|
||||
remove_flags_thread.start()
|
||||
config = Config()
|
||||
if config.general["logg_lvl"] == "info":
|
||||
Logger.init(logging.INFO)
|
||||
@@ -65,6 +54,5 @@ if __name__ == "__main__":
|
||||
break
|
||||
time.sleep(0.02)
|
||||
|
||||
remove_flags_thread.join()
|
||||
print("Press Enter to exit ...")
|
||||
input()
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
from keyboard._winkeyboard import CallNextHookEx, LowLevelKeyboardProc, GetModuleHandleW, SetWindowsHookEx, UnhookWindowsHookEx, GetMessage, TranslateMessage, DispatchMessage, DWORD, c_int, LPMSG
|
||||
import atexit
|
||||
|
||||
LLKHF_INJECTED = 0x00000010
|
||||
LLMHF_INJECTED = 0x00000001
|
||||
|
||||
def remove_key_flags():
|
||||
def low_level_handler(nCode, wParam, lParam):
|
||||
lParam.contents.flags &= ~LLKHF_INJECTED
|
||||
lParam.contents.flags &= ~LLMHF_INJECTED
|
||||
return CallNextHookEx(None, nCode, wParam, lParam)
|
||||
|
||||
WH_KEYBOARD_LL = c_int(13)
|
||||
keyboard_callback = LowLevelKeyboardProc(low_level_handler)
|
||||
handle = GetModuleHandleW(None)
|
||||
thread_id = DWORD(0)
|
||||
keyboard_hook = SetWindowsHookEx(WH_KEYBOARD_LL, keyboard_callback, handle, thread_id)
|
||||
atexit.register(UnhookWindowsHookEx, keyboard_callback)
|
||||
|
||||
if __name__ == "__main__":
|
||||
remove_key_flags()
|
||||
msg = LPMSG()
|
||||
while not GetMessage(msg, 0, 0, 0):
|
||||
TranslateMessage(msg)
|
||||
DispatchMessage(msg)
|
||||
@@ -1,23 +0,0 @@
|
||||
from mouse._winmouse import CallNextHookEx, NULL, c_int, LowLevelMouseProc, SetWindowsHookEx, UnhookWindowsHookEx, LPMSG, GetMessage, TranslateMessage, DispatchMessage
|
||||
import atexit
|
||||
|
||||
LLKHF_INJECTED = 0x00000010
|
||||
LLMHF_INJECTED = 0x00000001
|
||||
|
||||
def remove_mouse_flag():
|
||||
def low_level_mouse_handler(nCode, wParam, lParam):
|
||||
lParam.contents.flags &= ~LLKHF_INJECTED
|
||||
lParam.contents.flags &= ~LLMHF_INJECTED
|
||||
return CallNextHookEx(NULL, nCode, wParam, lParam)
|
||||
|
||||
WH_MOUSE_LL = c_int(14)
|
||||
mouse_callback = LowLevelMouseProc(low_level_mouse_handler)
|
||||
mouse_hook = SetWindowsHookEx(WH_MOUSE_LL, mouse_callback, NULL, NULL)
|
||||
atexit.register(UnhookWindowsHookEx, mouse_callback)
|
||||
|
||||
if __name__ == "__main__":
|
||||
remove_mouse_flag()
|
||||
msg = LPMSG()
|
||||
while not GetMessage(msg, 0, 0, 0):
|
||||
TranslateMessage(msg)
|
||||
DispatchMessage(msg)
|
||||
Reference in New Issue
Block a user