public BindableButton registerBindButton(SimpleUri bindId, String displayName, BindButtonEvent @event) { BindableButtonImpl bind = new BindableButtonImpl(bindId, displayName, @event); buttonLookup.put(bindId, bind); buttonBinds.add(bind); return(bind); }
public BindableButton getBindButton(SimpleUri bindId) { BindableButton button; if (buttonLookup.TryGetValue(bindId, out button)) { return(button); } return(null); }
public void linkBindButtonToMouseWheel(int direction, SimpleUri bindId) { if (direction > 0) { mouseWheelDownBind = buttonLookup.get(bindId); } else if (direction < 0) { mouseWheelUpBind = buttonLookup.get(bindId); } }
public void linkBindButtonToInput(InputEvent input, SimpleUri bindId) { if (input is KeyEvent) { linkBindButtonToKey(((KeyEvent)input).getKey().getId(), bindId); } else if (input is MouseButtonEvent) { linkBindButtonToMouse(((MouseButtonEvent)input).getButton(), bindId); } else if (input is MouseWheelEvent) { linkBindButtonToMouseWheel(((MouseWheelEvent)input).getWheelTurns(), bindId); } }
public void linkBindButtonToInput(Input input, SimpleUri bindId) { switch (input.getType()) { case KEY: linkBindButtonToKey(input.getId(), bindId); break; case MOUSE_BUTTON: MouseInput button = MouseInput.find(input.getType(), input.getId()); linkBindButtonToMouse(button, bindId); break; case MOUSE_WHEEL: linkBindButtonToMouseWheel(input.getId(), bindId); break; default: break; } }
public BindableButton registerBindButton(SimpleUri bindId, String displayName) { return(registerBindButton(bindId, displayName, new BindButtonEvent())); }
public BindableAxis registerBindAxis(String id, BindAxisEvent @event, SimpleUri positiveButtonId, SimpleUri negativeButtonId) { return(registerBindAxis(id, @event, getBindButton(positiveButtonId), getBindButton(negativeButtonId))); }
public void linkBindButtonToMouse(MouseInput mouseButton, SimpleUri bindId) { BindableButtonImpl bindInfo = buttonLookup.get(bindId); mouseButtonBinds.put(mouseButton, bindInfo); }
public void linkBindButtonToKey(int key, SimpleUri bindId) { BindableButtonImpl bindInfo = buttonLookup.get(bindId); keyBinds.put(key, bindInfo); }