예제 #1
0
        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);
        }
예제 #2
0
 protected internal virtual void KeyBindUp(GUIBoundKeyEventArgs args)
 {
     OnKeyBindUp?.Invoke(args);
 }