Commit 91ab02c0 authored by rajneesh's avatar rajneesh

Screenshot number printed on terminal

parent e08e204a
......@@ -91,12 +91,10 @@ def bind_sockets():
cam_port=9998
cameraSocket.bind(("0.0.0.0", cam_port))
#print("Camera stream port: "+ str(cam_port))
cameraSocket.listen(10)
key_port=6666
s.bind(("0.0.0.0", key_port))
#print("Keyboard and Mouse Listening port: "+ str(key_port))
s.listen(10)
print("Wireless Server Up and Running........\n")
......@@ -136,8 +134,6 @@ def mouse_keyboard_connections():
try:
conn, address = s.accept()
#Mouse coordinates receiving function
#print("Mouse Accept")
peer_response=str(conn.recv(1024).decode("utf-8"))
if "!#Mouse#!" in peer_response:
......@@ -150,8 +146,6 @@ def mouse_keyboard_connections():
peer_response=peer_response.split("!#Keyboard#!")[1]
if peer_response in special_key_android_dictionary.keys():
print("Special: "+ special_key_android_dictionary[peer_response])
if peer_response == "Backspace":
keyboard.press(Key.backspace)
keyboard.release(Key.backspace)
......@@ -167,15 +161,13 @@ def mouse_keyboard_connections():
keyboard.release(Key.cmd)
elif peer_response == "Print\nScreen":
print("Entered Print Screen: "+ str(screenshot_count))
print("\nScreenshot saved as: "+"screenshot_"+str(screenshot_count)+".png")
autopy.bitmap.capture_screen().save(str("screenshot_"+str(screenshot_count)+".png"))
screenshot_count+=1
else:
print("Not Special :"+peer_response)
if peer_response.isalnum and peer_response != "'" and peer_response != "<":
print("Is Alpha Numeric")
autopy.key.tap(peer_response.lower())
elif peer_response == "'":
keyboard.press("'")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment