Example #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);
        }
Example #2
0
        public BindableButton getBindButton(SimpleUri bindId)
        {
            BindableButton button;

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

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

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

            keyBinds.put(key, bindInfo);
        }