11
11
#
12
12
# Change History
13
13
# --------------
14
- # 2020-09-22 : 0.1 : WMF : Created. Ignore the comments.
14
+ # 2020-09-22 : 0.1 : WMF : Created.
15
+ # 2020-09-24 : 0.2 : WMF : Removed commented out test code.
15
16
#
16
17
17
18
import tkinter
22
23
23
24
def countDown ():
24
25
'''start countdown seconds'''
25
- #clock.config(bg='yellow')
26
26
for k in range (3 , - 1 , - 1 ):
27
27
clock ["text" ] = k
28
28
time .sleep (1 )
29
29
root .update () # Tk needs this after sleep()
30
- # clock.config(bg='red')
31
30
clock ["text" ] = "Done"
32
31
33
32
root = tkinter .Tk ()
@@ -39,36 +38,14 @@ def submitFunction():
39
38
global clipboard
40
39
button .place_forget ()
41
40
countDown ()
41
+
42
42
# Click into window
43
43
x , y = pyautogui .position ()
44
44
pyautogui .click (x , y )
45
- # Special Characters
46
- #clipboard = clipboard.replace("#", "\#")
47
- # Paste / Type
48
-
49
- #print(clipboard)
50
- #pyautogui.typewrite(clipboard)
51
- #print(pyautogui._pyautogui_win.keyboardMapping['@'])
52
- #print()
53
- #pyautogui.platformModule.keyboardMapping['#'] = 478
54
- #print(pyautogui._pyautogui_win.keyboardMapping['~'])
55
-
56
- #default_layout = win32api.GetKeyboardLayout()
57
- #print (default_layout)
58
- #print (hex(default_layout))
59
-
60
- #win32api.LoadKeyboardLayout('00000409',1) # to switch to US english
61
- #print (win32api.GetKeyboardLayout())
62
- #win32api.LoadKeyboardLayout(default_layout,1) # switch back
63
- #print (win32api.GetKeyboardLayout())
64
-
65
- #pyautogui.typewrite("###")
45
+
46
+ # "Paste"
66
47
keyboard .write (clipboard )
67
48
ready .set (1 )
68
- #root.destroy()
69
-
70
- # label_font = ('helvetica', 40)
71
- # clock = tkinter.Label(font=label_font)
72
49
73
50
clipboard = root .clipboard_get ()
74
51
@@ -81,24 +58,4 @@ def submitFunction():
81
58
button = tkinter .Button (root , text = "Ready" , command = submitFunction )
82
59
button .place (relx = .5 , rely = .7 , anchor = "c" )
83
60
84
- root .wait_variable (ready )
85
-
86
- # root.mainloop()
87
-
88
- #--------
89
-
90
- #B1 = tkinter.Button(root, text ="circle", cursor="circle")
91
- #B2 = tkinter.Button(root, text ="plus", cursor="plus")
92
- #B1.pack()
93
- #B2.pack()
94
- #root.mainloop()
95
-
96
- #--------
97
-
98
- #var = tkinter.IntVar()
99
- #button = tkinter.Button(root, text="Ready", command=lambda: var.set(1))
100
- #button.place(relx=.5, rely=.8, anchor="c")
101
-
102
- #print("Ready to paste...")
103
- #button.wait_variable(var)
104
- #print("Paste Now.")
61
+ root .wait_variable (ready )
0 commit comments