def poll(self):
    with self.awaitingResponseLock:
        input = self.readFromDevice()
    if (input != None):
        if ((input[0] == KeyCode.JOG.value) and (input[1:].isdecimal() or ((input[1] == '-') and input[2:].isdecimal()))):
            if (KeyCode.JOG.value in self.callbacks):
                self.callbacks[KeyCode.JOG.value](int(input[1:]))
        elif (input in self.callbacks):
            self.callbacks[input]()
def poll(self):
    with self.awaitingResponseLock:
        input = self.readFromDevice()
    if (input != None):
        if ((input[0] == KeyCode.JOG.value) and (input[1:].isdecimal() or ((input[1] == '-') and input[2:].isdecimal()))):
            if (KeyCode.JOG.value in self.callbacks):
                self.callbacks[KeyCode.JOG.value](int(input[1:]))
        elif (input in self.callbacks):
            self.callbacks[input]()