confirmed keypress works on mac and mario runs right

master
Bel LaPointe 2023-03-02 09:27:30 -07:00
parent 5f59054366
commit 7202fef15d
1 changed files with 10 additions and 8 deletions

View File

@ -13,12 +13,14 @@ func TestKeyboardIntegration(t *testing.T) {
kb := output.NewKeyboard()
t.Cleanup(kb.Close)
t.Log("pressing 'a' for 5 seconds")
kb.Press(key.A)
for i := 0; i < 5; i++ {
t.Logf("\t%d...", 5-i)
time.Sleep(time.Second)
}
t.Logf("releasing")
kb.Press()
t.Run("hold d", func(t *testing.T) {
t.Log("pressing 'd' for 5 seconds")
kb.Press(key.D)
for i := 0; i < 5; i++ {
t.Logf("\t%d...", 5-i)
time.Sleep(time.Second)
}
t.Logf("releasing")
kb.Press()
})
}