예제 #1
0
        public CMouseBinding(T inputID, MouseButton key, BroadcastKeyState keystate)

            : base(inputID, keystate)

        {
            _BoundInputValues[key] = false;
        }
예제 #2
0
        public CVarBroadcastBinding(T inputID, BroadcastKeyState keystate)

            : base(inputID)

        {
            KeyStateToBroadcast = keystate;
        }
예제 #3
0
        private void UnregisterMouseInernal(T BindKey, MouseButton btn, BroadcastKeyState listenKeyState)

        {
            if (_BindingMap.ContainsKey(BindKey) == false)

            {
                return;
            }



            foreach (IInputBinding binding in _BindingMap[BindKey])

            {
                // ensure we are axis type

                if (binding.GetType() == typeof(CMouseBinding <T>))

                {
                    CMouseBinding <T> keyBind = binding as CMouseBinding <T>;



                    // ensure we match the key state to broadcast

                    if (keyBind.KeyStateToBroadcast != listenKeyState)
                    {
                        continue;
                    }



                    // ensure we match the key

                    // NOTE: seems redundant with the dictionary, but was how im keeping things generic over there

                    //       BUT! it should always have 1 key in there... should... maybe i should use an assert?       nah

                    // Yup... copy pasta...

                    List <MouseButton> heldKeys = new List <MouseButton>(keyBind.BoundInputValues.Keys);

                    if (heldKeys[0] != btn)

                    {
                        continue;
                    }



                    // save to remove

                    _BindingMap[BindKey].Remove(binding);

                    return; // must retun here to avoid a sync runtime error
                }
            }
        }
예제 #4
0
        public CKeyBinding(T inputID, KeyCode key, BroadcastKeyState keystate) : base(inputID, keystate)

        {
            _BoundInputValues[key] = false;



            IsJoystick = key.ToString().Contains("Joystick");
        }
예제 #5
0
        private void RegisterMouseInernal(T BindKey, MouseButton btn, BroadcastKeyState listenKeyState)

        {
            if (_BindingMap.ContainsKey(BindKey) == false)

            {
                _BindingMap.Add(BindKey, new List <IInputBinding>());
            }

            _BindingMap[BindKey].Add(new CMouseBinding <T>(BindKey, btn, listenKeyState));
        }
예제 #6
0
        private void RegisterKeyInernal(T BindKey, KeyCode key, BroadcastKeyState listenKeyState)

        {
            if (_BindingMap.ContainsKey(BindKey) == false)

            {
                _BindingMap.Add(BindKey, new List <IInputBinding>());
            }

            _BindingMap[BindKey].Add(new CKeyBinding <T>(BindKey, key, listenKeyState));
        }
예제 #7
0
        public void RegisterMouse(object BindKey, MouseButton btn, BroadcastKeyState listenKeyState)

        {
            RegisterMouseMethod.Invoke(null, new[] { BindKey, btn, listenKeyState });
        }
예제 #8
0
        public void RegisterKey(object BindKey, KeyCode key, BroadcastKeyState listenKeyState)

        {
            RegisterKeyInputMethod.Invoke(null, new[] { BindKey, key, listenKeyState });
        }
예제 #9
0
        public static void UnregisterMouse(T BindKey, MouseButton btn, BroadcastKeyState listenKeyState)

        {
            Instance.UnregisterMouseInernal(BindKey, btn, listenKeyState);
        }
예제 #10
0
        public static void UnregisterKey(T BindKey, KeyCode key, BroadcastKeyState listenKeyState)

        {
            Instance.UnregisterKeyInernal(BindKey, key, listenKeyState);
        }