예제 #1
0
        private void ProcessMessage(string msg)
        {
            string[] msgArray = ConvertMsgToArray(msg);

            if (msg.StartsWith("Gaze|"))
            {
                string zone = DetermineGazedZone(ClientStatus.gazePoint);

                ClientStatus.gazePoint.X = int.Parse(msgArray[0]);
                ClientStatus.gazePoint.Y = int.Parse(msgArray[1]);
                ClientStatus.gazePoint = Point.Add(ClientStatus.gazePoint, new Size(ClientStatus.ScreenTopLeft));

            }
            else if (msg.StartsWith("Commands|"))
            {


                    int X = int.Parse(msgArray[0]);
                    int Y = int.Parse(msgArray[1]);
                    PerformCommand(msgArray[3], new Point(X, Y));

              
            }
            else if (msg.StartsWith("Glyph|"))
            {




                if (msgArray[0] == "S")
                {

                    //frm_glyph.Show();
                    frm_glyph.DisplayImage(true);
                    // DisplayMessage("Show Glyph\r\n", textBox1);



                }
                else if (msgArray[0] == "H")
                {
                    try
                    {
                        frm_glyph.DisplayImage(false);
                        //  DisplayMessage("Hide Glyph\r\n", textBox1);
                    }
                    catch (Exception) { }

                }
            }
            else if (msg.StartsWith("Volume|"))
            {
                if (msgArray[1] == "Up" ) setVolume(msgArray[0]);
                else if ( msgArray[1] == "Down") setVolume("-"+ msgArray[0]);

            }
                  
        } 
예제 #2
0
        private void ProcessMessage(string msg)
        {
            string[] msgArray = ConvertMsgToArray(msg);

            if (msg.StartsWith("Gaze|"))
            {
                ClientStatus.gazePoint.X = int.Parse(msgArray[0]);
                ClientStatus.gazePoint.Y = int.Parse(msgArray[1]);
                if (moveCursor)
                {
                    Cursor.Position = Point.Add(ClientStatus.gazePoint, new Size(ClientStatus.ScreenTopLeft));
                }
            }
            else if (msg.StartsWith("Commands|"))
            {
                CommandHandler temp = commandHandler;
                if (temp != null)
                {
                    int        X    = int.Parse(msgArray[0]);
                    int        Y    = int.Parse(msgArray[1]);
                    myEventArg args = new myEventArg(msgArray[3], new Point(X, Y));
                    temp(this, args);
                }
            }
            else if (msg.StartsWith("Glyph|"))
            {
                if (msgArray[0] == "S")
                {
                    //frm_glyph.Show();
                    frm_glyph.DisplayImage(true);
                    // DisplayMessage("Show Glyph\r\n", textBox1);
                }
                else if (msgArray[0] == "H")
                {
                    try
                    {
                        frm_glyph.DisplayImage(false);
                        //  DisplayMessage("Hide Glyph\r\n", textBox1);
                    }
                    catch (Exception) { }
                }
            }
        }