input ignores newline chars
This commit is contained in:
@@ -50,9 +50,11 @@ func (kb Keyboard) Read() []Button {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
result := make([]Button, n)
|
||||
for i := range result {
|
||||
result[i] = Button{Char: b[i], Down: true}
|
||||
result := make([]Button, 0, n)
|
||||
for i := 0; i < n; i++ {
|
||||
if b[i] != '\n' {
|
||||
result = append(result, Button{Char: b[i], Down: true})
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user