use of org.terasology.input.internal.BindableButtonImpl in project Terasology by MovingBlocks.
the class BindsSubsystem method registerBindButton.
private BindableButton registerBindButton(SimpleUri bindId, String displayName, BindButtonEvent event) {
BindableButtonImpl bind = new BindableButtonImpl(bindId, displayName, event);
buttonLookup.put(bindId, bind);
buttonBinds.add(bind);
return bind;
}
use of org.terasology.input.internal.BindableButtonImpl in project Terasology by MovingBlocks.
the class InputSystemTests method testKeyBinding.
@Test
public void testKeyBinding() {
Map<Integer, BindableButton> keyBinds = new HashMap<>();
// mock binding to the TestEventButton, this is done by the BindsManager over the annotations by default
keyBinds.put(KeyId.T, new BindableButtonImpl(new SimpleUri("engine-tests", "testEvent"), "theTestEvent", new TestEventButton()));
when(bindsManager.getKeyBinds()).thenReturn(keyBinds);
pressKey(Key.T);
inputSystem.update(1f);
verify(clientEntity).send(Mockito.any(TestEventButton.class));
}
Aggregations