Example #1
0
        private void BrailleDis_keyStateChangedEvent(
            BrailleDisKeyboard pressedKeys,
            BrailleDisKeyboard releasedKeys,
            BrailleDisKeyboard keyboardState,
            int timeStampTickCount)
        {
            OrderedDictionary raw = new OrderedDictionary();

            raw.Add("pressedKeys", pressedKeys);
            raw.Add("releasedKeys", releasedKeys);
            raw.Add("keyboardState", keyboardState);
            raw.Add("timeStampTickCount", timeStampTickCount);
            raw.Add("allPressedKeys", BraillDisButtonInterpreter.toSingleBrailleKeyEventList(pressedKeys.AllKeys));
            raw.Add("allReleasedKeys", BraillDisButtonInterpreter.toSingleBrailleKeyEventList(releasedKeys.AllKeys));
            var bs = getButtonStates(raw);

            fireKeyStateChanged(bs, ref raw); //TODO: map generic buttons!
        }
Example #2
0
        private void BrailleDis_inputChangedEvent(
            bool touchInputAvailable,
            int[,] valueMatrix,
            BrailleDisKeyboard keyboardState,
            int timeStampTickCount)
        {
            OrderedDictionary raw = new OrderedDictionary();

            raw.Add("touchInputAvailable", touchInputAvailable);
            raw.Add("valueMatrix", valueMatrix);
            raw.Add("keyBoardState", keyboardState);
            raw.Add("timeStampTickCount", timeStampTickCount);
            bool[,] touches = new bool[valueMatrix.GetLength(0), valueMatrix.GetLength(1)];
            for (int i = 0; i < valueMatrix.GetLength(0); i++)
            {
                for (int j = 0; j < valueMatrix.GetLength(1); j++)
                {
                    touches[i, j] = ((double)Math.Round((double)valueMatrix[i, j]) != 0) ? true : false;
                }
            }

            fireInputChanged(touches, timeStampTickCount, ref raw);
        }