public CMouseBinding(T inputID, MouseButton key, BroadcastKeyState keystate) : base(inputID, keystate) { _BoundInputValues[key] = false; }
public CVarBroadcastBinding(T inputID, BroadcastKeyState keystate) : base(inputID) { KeyStateToBroadcast = keystate; }
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 } } }
public CKeyBinding(T inputID, KeyCode key, BroadcastKeyState keystate) : base(inputID, keystate) { _BoundInputValues[key] = false; IsJoystick = key.ToString().Contains("Joystick"); }
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)); }
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)); }
public void RegisterMouse(object BindKey, MouseButton btn, BroadcastKeyState listenKeyState) { RegisterMouseMethod.Invoke(null, new[] { BindKey, btn, listenKeyState }); }
public void RegisterKey(object BindKey, KeyCode key, BroadcastKeyState listenKeyState) { RegisterKeyInputMethod.Invoke(null, new[] { BindKey, key, listenKeyState }); }
public static void UnregisterMouse(T BindKey, MouseButton btn, BroadcastKeyState listenKeyState) { Instance.UnregisterMouseInernal(BindKey, btn, listenKeyState); }
public static void UnregisterKey(T BindKey, KeyCode key, BroadcastKeyState listenKeyState) { Instance.UnregisterKeyInernal(BindKey, key, listenKeyState); }