-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
99 lines (91 loc) · 18.2 KB
/
main.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
88
89
90
91
92
93
94
95
96
97
98
99
import darkdetect, pyautogui as pg, PySimpleGUI as PSG
from time import sleep
from threading import Thread
def icon():
return b'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAQAAAD2e2DtAAAodElEQVR4nO2deZgcV3mv36+quntmpNlkWYstS8Z4t2QtI9kYY2M7IYFwuRcS4AIGEiDxEoed5GHHOIGQhOAn3NybEJwEh80JkJtcSPIkBLxgNiPJDuANG7AWW7KsdbTMTHfVOfePqu6uc6q6p7pmJFnj8+qxZ7qm69RX53x16izf+R1wOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofDcTyR423AseEiIAI0XuuYtr4jrWOac/gh9x8r444rzwAHGEMjgPh6nh7waokPaK0MH1CiQCumqEcTvoa9LOQHx8XiY8mcd4Cx+Mk+nRdwKWezgErrniPjixoFaCZ4ikf5Nt/gSYBNx9bcY84cd4AxQAb0G7iBc1K1//Q0+AE38nUQNh4t454WzGkHWIfAAB/mLVRLnL6d6/mawJx2gV6eihMOhQevKVn8sIyPs0Zbb4q5xpx2AJ9omNeXLH6Ac3ibVOd0Fs1tBwBZxpkzSuAyfcosmfI0ZY47AIsZmtH5IyyeJUuepgTH24CjzEn0pz7t47Ps7drw1SzgdYy2Pg8wcrRMe3ow1x1g2Kjj9nEzj01zxun8t5QDVJl3NMx6+jDXHWDQ+ux1H9oZs1+KnlGDzEHmehtg/oxTcA5w4iIwMONE+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07gmHvYhe9wOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6HY/b5/+AVVQKNbJF3AAAAAElFTkSuQmCC'
def theme_selection():
"Detect either dark or light theme and generate the layout"
if darkdetect.isDark():
PSG.theme("DarkBlack")
else:
PSG.theme("LightBlue6")
layout = [
[PSG.Text("NumPad-Keys", tooltip="Will send a key as from the numpad after the duration\nNumbers can be chained")],
[PSG.Push(), PSG.Button("1", key="-NUM-1-", size=(3,1)), PSG.Button("2", key="-NUM-2-", size=(3,1)), PSG.Button("3", key="-NUM-3-", size=(3,1)), PSG.Push()],
[PSG.Push(), PSG.Button("4", key="-NUM-4-", size=(3,1)), PSG.Button("5", key="-NUM-5-", size=(3,1)), PSG.Button("6", key="-NUM-6-", size=(3,1)), PSG.Push()],
[PSG.Push(), PSG.Button("7", key="-NUM-7-", size=(3,1)), PSG.Button("8", key="-NUM-8-", size=(3,1)), PSG.Button("9", key="-NUM-9-", size=(3,1)), PSG.Push()],
[PSG.Push(), PSG.Button("0", key="-NUM-0-", size=(3,1)), PSG.Push()],
[PSG.Text("")],
[PSG.HorizontalSeparator()],
[PSG.Text("F-Keys", tooltip="Will enable to press all the function keys missing from the standard keyboard\nKey presses can be chained")],
[PSG.Push(), PSG.Button("F13", key="-F13-", size=(5,1)), PSG.Push(), PSG.Button("F14", key="-F14-", size=(5,1)), PSG.Push(), PSG.Button("F15", key="-F15-", size=(5,1)), PSG.Push(), PSG.Button("F16", key="-F16-", size=(5,1)), PSG.Push()],
[PSG.Push(), PSG.Button("F17", key="-F17-", size=(5,1)), PSG.Push(), PSG.Button("F18", key="-F18-", size=(5,1)), PSG.Push(), PSG.Button("F19", key="-F19-", size=(5,1)), PSG.Push(), PSG.Button("F20", key="-F20-", size=(5,1)), PSG.Push()],
[PSG.Push(), PSG.Button("F21", key="-F21-", size=(5,1)), PSG.Push(), PSG.Button("F22", key="-F22-", size=(5,1)), PSG.Push(), PSG.Button("F23", key="-F23-", size=(5,1)), PSG.Push(), PSG.Button("F24", key="-F24-", size=(5,1)), PSG.Push()],
[PSG.Text("")],
[PSG.HorizontalSeparator()],
[PSG.Text("Modifier-Keys", tooltip="Standard modifier keys on a toggle for easier use")],
[PSG.Checkbox("CTRL", key="-CTRL-", change_submits=True), PSG.Push(), PSG.Checkbox("SHIFT", key="-SHIFT-", change_submits=True), PSG.Push(), PSG.Checkbox("ESC", key="-ESC-", change_submits=True), PSG.Push(), PSG.Checkbox("ALT", key="-ALT-", change_submits=True)],
[PSG.Text("")],
[PSG.HorizontalSeparator()],
[PSG.Text("Settings")],
[PSG.Text("Delay (Seconds): ", tooltip="Delay, after which, the button will be pressed"), PSG.Input("2", key="-DELAY-INPUT-", size=(5,1))],
[PSG.Text("Duration (ms): ", tooltip="Duration, during which, the button will be pressed"), PSG.Input("50", key="-DURATION-INPUT-", size=(5,1), pad=((22,0), 0))],
[PSG.Checkbox("Keep Tool On Top", key="-KEEP-ON-TOP-", change_submits=True, default=True)],
[PSG.Text("")],
[PSG.HorizontalSeparator()],
[PSG.Text("Status: "), PSG.Text("IDLE", key="-STATUS-")]
]
return layout
def key_press(key:str, delay:float, duration:float, window:PSG.Window):
"""Send a key press after the delay and for the duration selected.
Window parameter is used to update the status indicator"""
window["-STATUS-"].update(f"Sending {key} in {delay}s")
sleep(delay)
window["-STATUS-"].update(f"Pressing {key}")
pg.keyDown(key)
sleep(duration)
pg.keyUp(key)
window["-STATUS-"].update("IDLE")
def main():
layout = theme_selection()
window = PSG.Window(f"PyKeyExtender | by Piombacciaio", layout, icon=icon(), finalize=True, keep_on_top=True, location=(0,0))
while 1:
events, values = window.read()
if events == PSG.WIN_CLOSED: break
#Update KeepOnTop
if events == "-KEEP-ON-TOP-":
if values["-KEEP-ON-TOP-"]:
window.keep_on_top_set()
else:
window.keep_on_top_clear()
#CTRL Hold
if events == "-CTRL-":
if values["-CTRL-"]:
pg.keyDown("ctrl")
else:
pg.keyUp("ctrl")
#SHIFT Hold
if events == "-SHIFT-":
if values["-SHIFT-"]:
pg.keyDown("shift")
else:
pg.keyUp("shift")
#DEL Hold
if events == "-ESC-":
if values["-ESC-"]:
pg.keyDown("esc")
else:
pg.keyUp("esc")
#ALT Hold
if events == "-ALT-":
if values["-ALT-"]:
pg.keyDown("alt")
else:
pg.keyUp("alt")
#Keys Handler
if events in [f"-NUM-{x}-" for x in range(0, 10)] or events in [f"-F{x}-" for x in range(13, 25)]:
delay = float(values["-DELAY-INPUT-"])
duration= float(values["-DURATION-INPUT-"])/1000
key = events.replace("-", "")
Thread(target=key_press, args=(key, delay, duration, window)).start()
if __name__ == '__main__': main()