}
@Test
public void testKeyboardBindings() {
KeyboardShortcuts ks = new KeyboardShortcuts();
final Flag flag = new Flag();
ks.addBinding(new KeyBinding('Z', true, false, false, new Command() {
@Override
public void execute() {
flag.up();
}
}));
flag.down();
ks.onShortcutPressed('s', false, false, false);
Assert.assertTrue(flag.isDown());
flag.down();
ks.onShortcutPressed('z', true, false, false);
Assert.assertTrue(flag.isUp());
flag.down();
ks.onShortcutPressed('z', true, true, false);
Assert.assertTrue(flag.isDown());
flag.down();
ks.onShortcutPressed('Z', true, false, false);
Assert.assertTrue(flag.isUp());
}