Example #1
0
 @Test
 public void testToggle() {
   key.toggle(true);
   assertTrue(key.isDown());
   key.toggle(false);
   assertFalse(key.isDown());
 }
Example #2
0
 @Test
 public void testClicking() {
   key.toggle(true);
   assertFalse(key.isClicked());
   key.tick();
   assertTrue(key.isClicked());
   key.tick();
   assertFalse(key.isClicked());
   key.toggle(false);
   assertFalse(key.isClicked());
   key.toggle(true);
   assertFalse(key.isClicked());
   key.tick();
   assertTrue(key.isClicked());
   key.tick();
   assertFalse(key.isClicked());
 }