@GameMaster1928/

Text Editing

HTML, CSS, JS

I use this project to edit random text.

fork
loading
Files
  • index.html
index.html
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
"""
< --- CTRL by GameMaster1928 --- >
Only works on windows.
Some characters only work with a US standard keyboard.
Some parts may also only work in python 32-bit.
"""

#--- Setup ---#
from sys import *
from ctypes import *
from time import sleep
user32 = windll.user32
kernel32 = windll.kernel32

kernel32.GlobalLock.argtypes = [ctypes.c_void_p]
kernel32.GlobalLock.restype = ctypes.c_void_p
kernel32.GlobalUnlock.argtypes = [ctypes.c_void_p]
user32.GetClipboardData.restype = ctypes.c_void_p

delay = 0.01

# Classes
class Point(Structure):
        _fields_ = [("x", c_long), ("y", c_long)]

####################################
###-- KEYBOARD CONTROL SECTION --###
####################################

# Category variables
letters = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"
shiftsymbols = "[email protected]#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?"


class key:
    #--- Key Code Variables ---#
    cancel = 0x03
    backspace = 0x08
    tab = 0x09
    enter = 0x0D
    shift = 0x10
    ctrl = 0x11
    alt = 0x12
    capslock = 0x14
    esc = 0x1B
    space = 0x20
    pgup = 0x21
    pgdown = 0x22
    end = 0x23
    home = 0x24
    leftarrow = 0x26
    uparrow = 0x26
    rightarrow = 0x27
    downarrow = 0x28
    select = 0x29
    print = 0x2A
    execute = 0x2B
    printscreen = 0x2C
    insert = 0x2D
    delete = 0x2E
    help = 0x2F
    num0 = 0x30
    num1 = 0x31
    num2 = 0x32
    num3 = 0x33
    num4 = 0x34
    num5 = 0x35
    num6 = 0x36
    num7 = 0x37
    num8 = 0x38
    num9 = 0x39
    a = 0x41
    b = 0x42
    c = 0x43
    d = 0x44
    e = 0x45
    f = 0x46
    g = 0x47
    h = 0x48
    i = 0x49
    j = 0x4A
    k = 0x4B
    l = 0x4C
    m = 0x4D
    n = 0x4E
    o = 0x4F
    p = 0x50
    q = 0x51
    r = 0x52
    s = 0x53
    t = 0x54
    u = 0x55
    v = 0x56
    w = 0x57
    x = 0x58
    y = 0x59
    z = 0x5A
    leftwin = 0x5B
    rightwin = 0x5C
    apps = 0x5D
    sleep = 0x5F
    numpad0 = 0x60
    numpad1 = 0x61
    numpad3 = 0x63
    numpad4 = 0x64
    numpad5 = 0x65
    numpad6 = 0x66
    numpad7 = 0x67
    numpad8 = 0x68
    numpad9 = 0x69
    multiply = 0x6A
    add = 0x6B
    seperator = 0x6C
    subtract = 0x6D
    decimal = 0x6E
    divide = 0x6F
    F1 = 0x70
    F2 = 0x71
    F3 = 0x72
    F4 = 0x73
    F5 = 0x74
    F6 = 0x75
    F7 = 0x76
    F8 = 0x77
    F9 = 0x78
    F10 = 0x79
    F11 = 0x7A
    F12 = 0x7B
    F13 = 0x7C
    F14 = 0x7D
    F15 = 0x7E
    F16 = 0x7F
    F17 = 0x80
    F19 = 0x82
    F20 = 0x83
    F21 = 0x84
    F22 = 0x85
    F23 = 0x86
    F24 = 0x87
    numlock = 0x90
    scrolllock = 0x91
    leftshift = 0xA0
    rightshift = 0xA1
    leftctrl = 0xA2
    rightctrl = 0xA3
    leftmenu = 0xA4
    rightmenu = 0xA5
    browserback = 0xA6
    browserforward = 0xA7
    browserrefresh = 0xA8
    browserstop = 0xA9
    browserfavories = 0xAB
    browserhome = 0xAC
    volumemute = 0xAD
    volumedown = 0xAE
    volumeup = 0xAF
    nexttrack = 0xB0
    prevoustrack = 0xB1
    stopmedia = 0xB2
    playpause = 0xB3
    launchmail = 0xB4
    selectmedia = 0xB5
    launchapp1 = 0xB6
    launchapp2 = 0xB7
    semicolon = 0xBA
    equals = 0xBB
    comma = 0xBC
    dash = 0xBD
    period = 0xBE
    slash = 0xBF
    accent = 0xC0
    openingsquarebracket = 0xDB
    backslash = 0xDC
    closingsquarebracket = 0xDD
    quote = 0xDE
    play = 0xFA
    zoom = 0xFB
    PA1 = 0xFD
    clear = 0xFE

    # Presses and releases the key
    def press(key):
        user32.keybd_event(key, 0, 0, 0)
        sleep(delay)
        user32.keybd_event(key, 0, 2, 0)
        sleep(delay)

    # Holds a key
    def hold(key):
        user32.keybd_event(key, 0, 0, 0)
        sleep(delay)

    # Releases a key
    def release(key):
        user32.keybd_event(key, 0, 2, 0)
        sleep(delay)

    # Types out a string
    def string(sentence):
        for letter in sentence:
            shift = letter in shiftsymbols
            fixedletter = "space"
            if letter == "`" or letter == "~":
                fixedletter = "accent"
            elif letter == "1" or letter == "!":
                fixedletter = "num1"
            elif letter == "2" or letter == "@":
                fixedletter = "num2"
            elif letter == "3" or letter == "#":
                fixedletter = "num3"
            elif letter == "4" or letter == "$":
                fixedletter = "num4"
            elif letter == "5" or letter == "%":
                fixedletter = "num5"
            elif letter == "6" or letter == "^":
                fixedletter = "num6"
            elif letter == "7" or letter == "&":
                fixedletter = "num7"
            elif letter == "8" or letter == "*":
                fixedletter = "num8"
            elif letter == "9" or letter == "(":
                fixedletter = "num9"
            elif letter == "0" or letter == ")":
                fixedletter = "num0"
            elif letter == "-" or letter == "_":
                fixedletter = "dash"
            elif letter == "=" or letter == "+":
                fixedletter = "equals"
            elif letter in letters:
                fixedletter = letter.lower()
            elif letter == "[" or letter == "{":
                fixedletter = "openingsquarebracket"
            elif letter == "]" or letter == "}":
                fixedletter = "closingsquarebracket"
            elif letter == "\\" or letter == "|":
                fixedletter == "backslash"
            elif letter == ";" or letter == ":":
                fixedletter = "semicolon"
            elif letter == "'" or letter == "\"":
                fixedletter = "quote"
            elif letter == "," or letter == "<":
                fixedletter = "comma"
            elif letter == "." or letter == ">":
                fixedletter = "period"
            elif letter == "/" or letter == "?":
                fixedletter = "slash"
            elif letter == "\n":
                fixedletter = "enter"
            keytopress = eval("key." + str(fixedletter))
            if shift:
                key.hold(key.shift)
                key.press(keytopress)
                key.release(key.shift)
            else:
                key.press(keytopress)

#################################
###-- MOUSE CONTROL SECTION --###
#################################
                        
class mouse:
    left = [0x0002, 0x0004]
    right = [0x0008, 0x00010]
    middle = [0x00020, 0x00040]

    # Gets position of mouse
    def pos():
        point = Point()
        user32.GetCursorPos(byref(point))
        return (point.x, point.y)

    # Moves mouse to a position
    def move(x, y):
        user32.SetCursorPos(x, y)

    # Presses and releases mouse
    def press(button):
        user32.mouse_event(button[0], 0, 0, 0, 0)
        sleep(delay)
        user32.mouse_event(button[1], 0, 0, 0, 0)
        sleep(delay)

    # Holds a mouse button
    def hold(button):
        user32.mouse_event(button[0], 0, 0, 0, 0)
        sleep(delay)

    # Releases a mouse button
    def release(button):
        user32.mouse_event(button[1])
        sleep(delay)

#############################
###-- CLIPBOARD SECTION --###
#############################

class clipboard:
    def text():

result
console