remove unused const and ignore single newline directly after delay

This commit is contained in:
lordwelch 2018-11-05 11:47:11 -08:00
parent 0b2415ac40
commit 5fbef47dde

View File

@ -46,8 +46,6 @@ const (
NONE = 0 NONE = 0
) )
const delayDelimiter = "⏲"
var ( var (
PressDelay time.Duration // PressDelay is the time in ms to delay befor sending a press event PressDelay time.Duration // PressDelay is the time in ms to delay befor sending a press event
ReleaseDelay time.Duration // ReleaseDelay is the time in ms to wait before sending the release event ReleaseDelay time.Duration // ReleaseDelay is the time in ms to wait before sending the release event
@ -179,6 +177,13 @@ func parseDelay(buffer []byte) (count int, delay time.Duration) {
sb.WriteRune(r) sb.WriteRune(r)
index += s index += s
} else { } else {
if r == '\r' {
index += s
r, s = utf8.DecodeRune(buffer[index:])
}
if r == '\n' {
index += s
}
break break
} }
} }