key.To/FromChar

This commit is contained in:
Bel LaPointe
2023-03-02 09:25:19 -07:00
parent 5d30297ec4
commit 5f59054366
10 changed files with 135 additions and 44 deletions

View File

@@ -22,7 +22,7 @@ func NewRandom(start, stop byte) *Random {
}
func (r *Random) Read() []Button {
if rand.Int()%2 == 0 {
if len(r.down) > 0 && rand.Int()%2 == 0 {
was := r.down
for i := range was {
was[i].Down = false