Beispiel #1
0
        public override int UnpackReceivedMessage()
        {
            int index = 0;

            UnpackDuties(ref index);                                                                 // Message Type

            sliderIndex    = Convert.ToInt32(MobileControlPackHelper.UnpackByte(_bytes, ref index)); // Index of the changed slider
            curSliderValue = MobileControlPackHelper.UnpackFloat(_bytes, ref index);                 // Current Slider Value

            return(index);
        }
Beispiel #2
0
        public override int UnpackReceivedMessage()
        {
            int index = 0;

            UnpackDuties(ref index);                                                                   // Message Type

            int fingerAmount = Convert.ToInt32(MobileControlPackHelper.UnpackByte(_bytes, ref index)); // Amount of fingers on the touch display

            fingerPositions = new List <FingerPosition>(fingerAmount);
            for (int ii = 0; ii < fingerAmount; ++ii)
            {
                FingerPosition fingerPos = new FingerPosition();
                fingerPos.fingerID = Convert.ToInt32(MobileControlPackHelper.UnpackByte(_bytes, ref index)); // Current Finger ID
                fingerPos.xPos     = MobileControlPackHelper.UnpackFloat(_bytes, ref index);                 // Current Finger xPos
                fingerPos.yPos     = MobileControlPackHelper.UnpackFloat(_bytes, ref index);                 // Current Finger yPos

                fingerPositions.Add(fingerPos);
            }

            return(index);
        }