Fixed race condition

This commit is contained in:
Kevin F 2023-03-13 22:25:04 -05:00
parent b941235007
commit a2e9ce6aeb
3 changed files with 6 additions and 6 deletions

View File

@ -107,7 +107,7 @@ for {
}
inputString = addXDoToolIfNonQWERTY(string(readData))
input := []byte("@{payload delimiter}" + inputString)
input := []byte(inputString)
if len(input) > 0 {
err = client.WriteMessage(websocket.TextMessage, input)
if err != nil {
@ -147,7 +147,7 @@ for {
}
log.Fatal(err)
}
err = client.WriteMessage(websocket.TextMessage, []byte("@{payload delimiter}" + key))
err = client.WriteMessage(websocket.TextMessage, []byte(key))
if err != nil {
log.Fatal("write:", err)
}

View File

@ -6,7 +6,7 @@ Copyright [Kevin Froman](https://chaoswebs.net/) [Licensed under GPLv3](LICENSE.
Work in progress
--- version
2.0.0
3.0.0
---

View File

@ -248,13 +248,13 @@ try:
except KeyError:
print("Unknown key: " + str(e_code))
if event.value == 1:
key_str = "@{keydown cmd}" + key_str
key_str = "@{payload delimiter}@{keydown cmd}" + key_str
log.append(e_code)
quit_if_necessry(log)
elif event.value == 0:
key_str = "@{keyup cmd}" + key_str
key_str = "@{payload delimiter}@{keyup cmd}" + key_str
elif event.value == 2:
key_str = "@{keyheld cmd}" + key_str
key_str = "@{payload delimiter}@{keyheld cmd}" + key_str
else:
print("Unknown value: " + str(event.value))
continue