private void SetBindState(KeyBinding binding, BoundKeyState state)
        {
            binding.State = state;
            var cmd = GetInputCommand(binding.Function);

            OnKeyBindStateChanged?.Invoke(new BoundKeyEventArgs(binding.Function, binding.State));
            if (state == BoundKeyState.Up)
            {
                OnKeyBindUp?.Invoke(binding.Function);
                cmd?.Disabled();
            }
            else
            {
                OnKeyBindDown?.Invoke(binding.Function);
                cmd?.Enabled();
            }

            var msg = _netManager.CreateNetMessage <MsgKeyFunctionStateChange>();

            msg.KeyFunction = keyMap.KeyFunctionID(binding.Function);
            msg.NewState    = state;
            _netManager.ClientSendMessage(msg);
        }
Exemple #2
0
 protected internal virtual void KeyBindDown(GUIBoundKeyEventArgs args)
 {
     OnKeyBindDown?.Invoke(args);
 }