Ejemplo n.º 1
0
 public void Evaluate(int spreadMax)
 {
     if (!FKeyIn.IsChanged && !FCapsIn.IsChanged && !FTimeIn.IsChanged)
     {
         return;
     }
     FOutput.SliceCount = FKeyIn.CombineWith(FTimeIn);
     for (int i = 0; i < FOutput.SliceCount; i++)
     {
         FOutput[i] = KeyboardStateNodes.Join(FKeyIn[i], FCapsIn[0], FTimeIn[i]);
     }
 }
Ejemplo n.º 2
0
        public void Evaluate(int spreadMax)
        {
            FTimeOut.SliceCount = spreadMax;

            for (int i = 0; i < spreadMax; i++)
            {
                var           keyEvent = FInput[i];
                ISpread <int> keyCode;
                int           time;
                bool          capsLock;

                if (keyEvent != null)
                {
                    KeyboardStateNodes.Split(keyEvent, out keyCode, out time, out capsLock);
                }
                else
                {
                    keyCode  = new Spread <int>();
                    time     = 0;
                    capsLock = false;
                }

                FKeyCodeOut[i] = keyCode;
                FCapsOut[i]    = capsLock;
                FTimeOut[i]    = time;
            }

            //KeyOut returns the keycodes symbolic names
            //it is a spread parallel to the keycodes
            //didn't want to create an extra binsize output, so...
            var keys = new List <string>();

            foreach (var bin in FKeyCodeOut)
            {
                foreach (var slice in bin)
                {
                    var key = (Keys)slice;
                    keys.Add(key.ToString());
                }
            }
            FKeyOut.AssignFrom(keys);
        }