input ignores newline chars
parent
17b2891f9a
commit
32c186e1e2
|
|
@ -50,9 +50,11 @@ func (kb Keyboard) Read() []Button {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result := make([]Button, n)
|
result := make([]Button, 0, n)
|
||||||
for i := range result {
|
for i := 0; i < n; i++ {
|
||||||
result[i] = Button{Char: b[i], Down: true}
|
if b[i] != '\n' {
|
||||||
|
result = append(result, Button{Char: b[i], Down: true})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue