keyglow 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- keyglow/__init__.py +0 -0
- keyglow/data.py +73 -0
- keyglow/export.py +161 -0
- keyglow/jokes.py +34 -0
- keyglow/keyboard.py +64 -0
- keyglow/logo.py +16 -0
- keyglow/main.py +384 -0
- keyglow/map.py +138 -0
- keyglow/monitor.py +193 -0
- keyglow/storage.py +57 -0
- keyglow-0.1.0.dist-info/METADATA +392 -0
- keyglow-0.1.0.dist-info/RECORD +15 -0
- keyglow-0.1.0.dist-info/WHEEL +5 -0
- keyglow-0.1.0.dist-info/entry_points.txt +2 -0
- keyglow-0.1.0.dist-info/top_level.txt +1 -0
keyglow/__init__.py
ADDED
|
File without changes
|
keyglow/data.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import string
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
KEY_STATS = {
|
|
5
|
+
key: 0 for key in string.ascii_uppercase
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
KEY_STATS.update({
|
|
10
|
+
|
|
11
|
+
# Numbers
|
|
12
|
+
"0": 0,
|
|
13
|
+
"1": 0,
|
|
14
|
+
"2": 0,
|
|
15
|
+
"3": 0,
|
|
16
|
+
"4": 0,
|
|
17
|
+
"5": 0,
|
|
18
|
+
"6": 0,
|
|
19
|
+
"7": 0,
|
|
20
|
+
"8": 0,
|
|
21
|
+
"9": 0,
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Symbols
|
|
25
|
+
"`": 0,
|
|
26
|
+
"-": 0,
|
|
27
|
+
"=": 0,
|
|
28
|
+
"[": 0,
|
|
29
|
+
"]": 0,
|
|
30
|
+
"\\": 0,
|
|
31
|
+
";": 0,
|
|
32
|
+
"'": 0,
|
|
33
|
+
",": 0,
|
|
34
|
+
".": 0,
|
|
35
|
+
"/": 0,
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# Special keys
|
|
39
|
+
"SPACE": 0,
|
|
40
|
+
"ENTER": 0,
|
|
41
|
+
"BACKSPACE": 0,
|
|
42
|
+
"TAB": 0,
|
|
43
|
+
"CAPSLOCK": 0,
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Modifiers
|
|
47
|
+
"SHIFT": 0,
|
|
48
|
+
"CTRL": 0,
|
|
49
|
+
"ALT": 0,
|
|
50
|
+
"SYSTEM": 0,
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# Navigation
|
|
54
|
+
"UP": 0,
|
|
55
|
+
"DOWN": 0,
|
|
56
|
+
"LEFT": 0,
|
|
57
|
+
"RIGHT": 0,
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# Function keys
|
|
61
|
+
"F1": 0,
|
|
62
|
+
"F2": 0,
|
|
63
|
+
"F3": 0,
|
|
64
|
+
"F4": 0,
|
|
65
|
+
"F5": 0,
|
|
66
|
+
"F6": 0,
|
|
67
|
+
"F7": 0,
|
|
68
|
+
"F8": 0,
|
|
69
|
+
"F9": 0,
|
|
70
|
+
"F10": 0,
|
|
71
|
+
"F11": 0,
|
|
72
|
+
"F12": 0,
|
|
73
|
+
})
|
keyglow/export.py
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import csv
|
|
3
|
+
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
|
|
7
|
+
from keyglow.storage import load_data
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
EXPORT_DIR = Path.home() / "KeyGlow" / "Exports"
|
|
11
|
+
|
|
12
|
+
def ensure_export_dir():
|
|
13
|
+
EXPORT_DIR.mkdir(parents=True, exist_ok=True)
|
|
14
|
+
|
|
15
|
+
def create_export_path(extension):
|
|
16
|
+
"""
|
|
17
|
+
Creates export folder and filename with timestamp.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
EXPORT_DIR.mkdir(
|
|
21
|
+
parents=True,
|
|
22
|
+
exist_ok=True
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
timestamp = datetime.now().strftime(
|
|
26
|
+
"%Y-%m-%d_%H-%M-%S"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
return EXPORT_DIR / (
|
|
30
|
+
f"keyglow_export_{timestamp}.{extension}"
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def export_json():
|
|
36
|
+
ensure_export_dir()
|
|
37
|
+
data = load_data()
|
|
38
|
+
|
|
39
|
+
file = create_export_path("json")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
with file.open(
|
|
43
|
+
"w",
|
|
44
|
+
encoding="UTF-8"
|
|
45
|
+
) as f:
|
|
46
|
+
|
|
47
|
+
json.dump(
|
|
48
|
+
data,
|
|
49
|
+
f,
|
|
50
|
+
indent=4,
|
|
51
|
+
ensure_ascii=False
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
return file
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def export_csv():
|
|
60
|
+
ensure_export_dir()
|
|
61
|
+
data = load_data()
|
|
62
|
+
|
|
63
|
+
file = create_export_path("csv")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
with file.open(
|
|
67
|
+
"w",
|
|
68
|
+
newline="",
|
|
69
|
+
encoding="UTF-8"
|
|
70
|
+
) as f:
|
|
71
|
+
|
|
72
|
+
writer = csv.writer(f)
|
|
73
|
+
|
|
74
|
+
writer.writerow(
|
|
75
|
+
[
|
|
76
|
+
"Key",
|
|
77
|
+
"Presses"
|
|
78
|
+
]
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
for key, presses in data.items():
|
|
83
|
+
|
|
84
|
+
writer.writerow(
|
|
85
|
+
[
|
|
86
|
+
key,
|
|
87
|
+
presses
|
|
88
|
+
]
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
return file
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def export_txt():
|
|
97
|
+
ensure_export_dir()
|
|
98
|
+
data = load_data()
|
|
99
|
+
|
|
100
|
+
file = create_export_path("txt")
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
total = sum(data.values())
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
sorted_data = sorted(
|
|
107
|
+
data.items(),
|
|
108
|
+
key=lambda x: x[1],
|
|
109
|
+
reverse=True
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
with file.open(
|
|
114
|
+
"w",
|
|
115
|
+
encoding="UTF-8"
|
|
116
|
+
) as f:
|
|
117
|
+
|
|
118
|
+
f.write(
|
|
119
|
+
"==============================\n"
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
f.write(
|
|
123
|
+
"KeyGlow Export\n"
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
f.write(
|
|
127
|
+
"==============================\n\n"
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
f.write(
|
|
132
|
+
f"Total key presses:\n{total}\n\n"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
f.write(
|
|
137
|
+
"Keyboard statistics:\n\n"
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
for key, presses in sorted_data:
|
|
142
|
+
|
|
143
|
+
f.write(
|
|
144
|
+
f"{key:<12}{presses}\n"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
f.write(
|
|
149
|
+
"\nPrivacy:\n\n"
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
f.write(
|
|
153
|
+
"KeyGlow stores only key frequency counters.\n"
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
f.write(
|
|
157
|
+
"No typed text, passwords or key sequences are recorded.\n"
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
return file
|
keyglow/jokes.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import random
|
|
2
|
+
|
|
3
|
+
KEYBOARD_JOKES = [
|
|
4
|
+
"The Career Change: I got fired from my job at the keyboard factory today. I just couldn't keep the space clean!",
|
|
5
|
+
"The Breakup: I tried dating a keyboard, but we had to break up... she just wasn't my type.",
|
|
6
|
+
"The Lost Keys: Why did the keyboard lose its job after the car accident? It lost all control. (trust me, this one is funny)",
|
|
7
|
+
"The Punctuation Problem: I took all the punctuation marks off the judge's keyboard. I expect a long sentence.",
|
|
8
|
+
"Why did the keyboard break up with the mouse? Because it felt like it was being controlled.",
|
|
9
|
+
"Why don't keyboards ever get tired? Because they always have a lot of keys.",
|
|
10
|
+
"I wanted to tell my keyboard a joke... but it didn't have the right key for humor.",
|
|
11
|
+
"My keyboard and I have a great relationship. We are always on the same page.",
|
|
12
|
+
"Why was the keyboard so good at music? Because it had the right keys.",
|
|
13
|
+
"The keyboard went to therapy. It had too many unresolved issues.",
|
|
14
|
+
"My keyboard told me a secret, but I couldn't understand it. It was written in uppercase. (Hella funny, just laugh gng)",
|
|
15
|
+
"Why did the programmer throw away his keyboard? It had too many bugs.",
|
|
16
|
+
"The spacebar walked into a bar. It was a very empty conversation.",
|
|
17
|
+
"Why did the enter key get promoted? Because it always knew how to make an entrance.",
|
|
18
|
+
"The CTRL key tried to relax but it couldn't let go of control.",
|
|
19
|
+
"The shift key is underrated. It always changes things.",
|
|
20
|
+
"The backspace key is the most forgiving key. It always gives you another chance. (Hella funny innit? (not really))",
|
|
21
|
+
"The keyboard was feeling depressed It just needed a little space",
|
|
22
|
+
"The keyboard looked at KeyGlow statistics and said: 'Finally someone appreciates how much I suffer every day' (yes, I am glazing my own tool)",
|
|
23
|
+
"The keyboard went on vacation. It needed some time away from all the pressure.",
|
|
24
|
+
"The spacebar is the most important key. Without it, everyone would just be typinglikethisandnobodywantsthat",
|
|
25
|
+
"What's Elon Musk's favourite keyboard shortcut? Ctrl + Space + X",
|
|
26
|
+
"Why do keyboards never sleep? Because they have two shifts.",
|
|
27
|
+
"What do you call a keyboard with one letter constantly pressed? O-Pressed.",
|
|
28
|
+
"Why do cats like to step on computer keyboards? because jfaeiogjea;g;elg,aiognaoghaoheioqj0jf0i1fap`D1j2orjew",
|
|
29
|
+
"How do you type the word 'Royalty' on the keyboard? You start with the higher R key.",
|
|
30
|
+
"My wife told me that she would smash my face into the keyboard if I didn't stop being misogynist... And that's when I let her know that I'm the Man of the House, the King of the Castle, the Lord of the Mancjkkf no jskslskf d j.lo alsjdj djdjslai48 err is shwks9ri3jekdo 3irbdjdibsks."
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
def get_joke():
|
|
34
|
+
return random.choice(KEYBOARD_JOKES)
|
keyglow/keyboard.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
KEYBOARD_LAYOUT = [
|
|
2
|
+
# FUNCTIONS
|
|
3
|
+
[
|
|
4
|
+
"ESC",
|
|
5
|
+
"F1", "F2", "F3", "F4",
|
|
6
|
+
"F5", "F6", "F7", "F8",
|
|
7
|
+
"F9", "F10", "F11", "F12"
|
|
8
|
+
],
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# NUMBERS
|
|
12
|
+
[
|
|
13
|
+
"`",
|
|
14
|
+
"1", "2", "3", "4", "5",
|
|
15
|
+
"6", "7", "8", "9", "0",
|
|
16
|
+
"-", "=",
|
|
17
|
+
"BACKSPACE"
|
|
18
|
+
],
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# Q ROW
|
|
22
|
+
[
|
|
23
|
+
"TAB",
|
|
24
|
+
"Q", "W", "E", "R", "T",
|
|
25
|
+
"Y", "U", "I", "O", "P",
|
|
26
|
+
"[", "]"
|
|
27
|
+
],
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# A ROW
|
|
31
|
+
[
|
|
32
|
+
"CAPSLOCK",
|
|
33
|
+
"A", "S", "D", "F", "G",
|
|
34
|
+
"H", "J", "K", "L",
|
|
35
|
+
";", "'", "\\",
|
|
36
|
+
"ENTER"
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# Z ROW
|
|
41
|
+
[
|
|
42
|
+
"SHIFT",
|
|
43
|
+
"Z", "X", "C", "V", "B",
|
|
44
|
+
"N", "M",
|
|
45
|
+
",", ".", "/",
|
|
46
|
+
"SHIFT"
|
|
47
|
+
],
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# BOTTOM ROW
|
|
51
|
+
[
|
|
52
|
+
"CTRL",
|
|
53
|
+
"ALT",
|
|
54
|
+
"SYSTEM",
|
|
55
|
+
"SPACE",
|
|
56
|
+
"SYSTEM",
|
|
57
|
+
"ALT",
|
|
58
|
+
"CTRL",
|
|
59
|
+
"LEFT",
|
|
60
|
+
"UP",
|
|
61
|
+
"DOWN",
|
|
62
|
+
"RIGHT"
|
|
63
|
+
]
|
|
64
|
+
]
|
keyglow/logo.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from rich import print
|
|
2
|
+
|
|
3
|
+
LOGO = r"""
|
|
4
|
+
██╗ ██╗███████╗██╗ ██╗ ██████╗ ██╗ ██████╗ ██╗ ██╗
|
|
5
|
+
██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██║ ██╔═══██╗██║ ██║
|
|
6
|
+
█████╔╝ █████╗ ╚████╔╝ ██║ ███╗██║ ██║ ██║██║ █╗ ██║
|
|
7
|
+
██╔═██╗ ██╔══╝ ╚██╔╝ ██║ ██║██║ ██║ ██║██║███╗██║
|
|
8
|
+
██║ ██╗███████╗ ██║ ╚██████╔╝███████╗╚██████╔╝╚███╔███╔╝
|
|
9
|
+
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚══════╝╚═════╝ ╚══╝╚══╝
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def show_logo():
|
|
13
|
+
print(f"[bold cyan]{LOGO}[/bold cyan]")
|
|
14
|
+
print("[dim]Privacy-first keyboard usage heatmap and statistics.[/dim]")
|
|
15
|
+
print("[dim]Version 0.1.0[/dim]\n")
|
|
16
|
+
|