create input functionality

This commit is contained in:
Jonas Zeunert
2019-10-30 21:37:16 +01:00
parent be7b72244a
commit bdba9fc7c3
5 changed files with 124 additions and 1 deletions

View File

@@ -46,4 +46,10 @@ class Networking:
self.get("/displays" + display + "/write_score/" + str(score))
def getInputEvent(self):
return self.input_socket.recvmsg(4096)
header = ''
while b'2' not in header:
header += self.input_socket.recv()
length = int(header[:-1])
return self.input_socket.recv(length)