diff --git a/.gitignore b/.gitignore index e51e33f..22716a1 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,10 @@ build/pasta/xref-pasta.html *.exe test.py pasta.spec +*.zip +build/mouse_jiggle/mouse_jiggle.exe.manifest +*.pkg +*.pyz +build/mouse_jiggle/warn-mouse_jiggle.txt +build/mouse_jiggle/xref-mouse_jiggle.html +*.spec diff --git a/README.md b/README.md index f9ab772..f3e77db 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ | Version | | - | -| 0.1 | +| 0.2 | ## Summary diff --git a/mouse_jiggle.py b/mouse_jiggle.py new file mode 100644 index 0000000..bcde3d2 --- /dev/null +++ b/mouse_jiggle.py @@ -0,0 +1,17 @@ +# Mouse Jiggle +# +# Author: Wes Moskal-Fitzpatrick +# +# Jiggle the mouse a little bit and prevent remote desktop logout. +# + +import pyautogui + +while True: + pyautogui.moveRel(5,0, duration=0) + #pyautogui.moveRel(0,5, duration=0.25) + pyautogui.PAUSE = 0.5 + pyautogui.moveRel(-5,0, duration=0) + #pyautogui.moveRel(0,-5, duration=0.25) + #pyautogui.click() + pyautogui.press('shift') \ No newline at end of file diff --git a/pasta.py b/pasta.py index 624b494..1e1f24c 100644 --- a/pasta.py +++ b/pasta.py @@ -11,7 +11,8 @@ # # Change History # -------------- -# 2020-09-22 : 0.1 : WMF : Created. Ignore the comments. +# 2020-09-22 : 0.1 : WMF : Created. +# 2020-09-24 : 0.2 : WMF : Removed commented out test code. # import tkinter @@ -22,12 +23,10 @@ def countDown(): '''start countdown seconds''' - #clock.config(bg='yellow') for k in range(3, -1, -1): clock["text"] = k time.sleep(1) root.update() # Tk needs this after sleep() - # clock.config(bg='red') clock["text"] = "Done" root = tkinter.Tk() @@ -39,36 +38,14 @@ def submitFunction(): global clipboard button.place_forget() countDown() + # Click into window x, y = pyautogui.position() pyautogui.click(x, y) - # Special Characters - #clipboard = clipboard.replace("#", "\#") - # Paste / Type - - #print(clipboard) - #pyautogui.typewrite(clipboard) - #print(pyautogui._pyautogui_win.keyboardMapping['@']) - #print() - #pyautogui.platformModule.keyboardMapping['#'] = 478 - #print(pyautogui._pyautogui_win.keyboardMapping['~']) - - #default_layout = win32api.GetKeyboardLayout() - #print (default_layout) - #print (hex(default_layout)) - - #win32api.LoadKeyboardLayout('00000409',1) # to switch to US english - #print (win32api.GetKeyboardLayout()) - #win32api.LoadKeyboardLayout(default_layout,1) # switch back - #print (win32api.GetKeyboardLayout()) - - #pyautogui.typewrite("###") + + # "Paste" keyboard.write(clipboard) ready.set(1) - #root.destroy() - -# label_font = ('helvetica', 40) -# clock = tkinter.Label(font=label_font) clipboard = root.clipboard_get() @@ -81,24 +58,4 @@ def submitFunction(): button = tkinter.Button(root, text="Ready", command=submitFunction) button.place(relx=.5, rely=.7, anchor="c") -root.wait_variable(ready) - -# root.mainloop() - -#-------- - -#B1 = tkinter.Button(root, text ="circle", cursor="circle") -#B2 = tkinter.Button(root, text ="plus", cursor="plus") -#B1.pack() -#B2.pack() -#root.mainloop() - -#-------- - -#var = tkinter.IntVar() -#button = tkinter.Button(root, text="Ready", command=lambda: var.set(1)) -#button.place(relx=.5, rely=.8, anchor="c") - -#print("Ready to paste...") -#button.wait_variable(var) -#print("Paste Now.") \ No newline at end of file +root.wait_variable(ready) \ No newline at end of file