Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public BindableButton getBindButton(SimpleUri bindId)
        {
            BindableButton button;

            if (buttonLookup.TryGetValue(bindId, out button))
            {
                return(button);
            }

            return(null);
        }
Exemplo n.º 3
0
 public void linkBindButtonToMouseWheel(int direction, SimpleUri bindId)
 {
     if (direction > 0)
     {
         mouseWheelDownBind = buttonLookup.get(bindId);
     }
     else if (direction < 0)
     {
         mouseWheelUpBind = buttonLookup.get(bindId);
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
        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;
            }
        }
Exemplo n.º 6
0
 public BindableButton registerBindButton(SimpleUri bindId, String displayName)
 {
     return(registerBindButton(bindId, displayName, new BindButtonEvent()));
 }
Exemplo n.º 7
0
 public BindableAxis registerBindAxis(String id, BindAxisEvent @event, SimpleUri positiveButtonId, SimpleUri negativeButtonId)
 {
     return(registerBindAxis(id, @event, getBindButton(positiveButtonId), getBindButton(negativeButtonId)));
 }
Exemplo n.º 8
0
        public void linkBindButtonToMouse(MouseInput mouseButton, SimpleUri bindId)
        {
            BindableButtonImpl bindInfo = buttonLookup.get(bindId);

            mouseButtonBinds.put(mouseButton, bindInfo);
        }
Exemplo n.º 9
0
        public void linkBindButtonToKey(int key, SimpleUri bindId)
        {
            BindableButtonImpl bindInfo = buttonLookup.get(bindId);

            keyBinds.put(key, bindInfo);
        }