示例#1
0
        public override bool HandleCmdMessage(ICommonSession session, InputCmdMessage message)
        {
            if (!(message is FullInputCmdMessage msg) || msg.State != BoundKeyState.Down)
            {
                return(false);
            }

            _callback?.Invoke(session, msg.Coordinates, msg.Uid);

            return(true);
        }
示例#2
0
        /// <inheritdoc />
        public override bool HandleCmdMessage(ICommonSession session, InputCmdMessage message)
        {
            if (!(message is FullInputCmdMessage msg))
            {
                return(false);
            }

            switch (msg.State)
            {
            case BoundKeyState.Up:
                _disabled?.Invoke(session, msg.Coordinates, msg.Uid);
                return(true);

            case BoundKeyState.Down:
                _enabled?.Invoke(session, msg.Coordinates, msg.Uid);
                return(true);
            }

            //Client Sanitization: unknown key state, just ignore
            return(false);
        }