-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui_methods.py
58 lines (42 loc) · 2.06 KB
/
gui_methods.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
from constants import constants
from gui_variables import gui_variables
from gui_read_key import KeyReader
# BUG: Fix error in the code below
# In each of the functions below, is error with applying the new value to the gui_variable.py file
def change_key(key_entry, key_var, set_constant_func):
key_entry.configure(state='normal', text_color='white')
key_reader = KeyReader(gui_variables.root)
gui_variables.root.wait_window(key_reader)
if key_reader.key_pressed:
key_var.set(key_reader.key_pressed)
set_constant_func(key_reader.key_pressed)
key_entry.configure(text_color='grey')
def activation_key_change():
change_key(gui_variables.activation_key_entry, gui_variables.activation_key_var,
lambda key: setattr(constants, 'activation_key', key))
def quit_key_change():
change_key(gui_variables.quit_key_entry, gui_variables.quit_key_var,
lambda key: setattr(constants, 'quit_key', key))
# this is next function that needs to be fixed
def update_activation_mode():
new_mode = gui_variables.activation_mode_var.get()
if new_mode != constants.activation_mode:
constants.activation_mode = new_mode
print("Activation mode updated:", constants.activation_mode)
else:
print("Activation mode not changed:", constants.activation_mode)
def update_cps():
constants.clicks_per_second = gui_variables.cps_var.get()
gui_variables.cps_display_label.configure(text=str(gui_variables.cps_var.get()))
gui_variables.root.update_idletasks()
print("CPS updated:", constants.clicks_per_second)
print("CPS updated2:", gui_variables.cps_var.get())
def update_cps_randomize():
constants.cps_randomize = gui_variables.cps_randomize_var.get()
print("CPS Randomize updated:", constants.cps_randomize)
def update_jitter_click_movement():
constants.jitter_click_movement = gui_variables.jitter_click_movement_var.get()
print("Jitter Click Movement updated:", constants.jitter_click_movement)
def quit_application():
constants.running = False
gui_variables.root.destroy()