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

View File

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

View File

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