Exemplo n.º 1
1
        private static void Main()
        {
            try
            {
                #region //IE Handle

                /*
            string ie_path = @"C:\Program Files\Internet Explorer\iexplore.exe";
            string ie_win_class = "IEFrame";
            string ie_win_nm = "New Tab - Windows Internet Explorer";
            ExtProgramHandle ie_handle = new ExtProgramHandle(ie_path, ie_win_class, ie_win_nm);
            ie_handle.bring_to_ForeGround();
            ie_handle.set_show_state(ShowState.SW_FORCEMINIMIZE);
            Thread.Sleep(2000);
            ie_handle.exitApplication();
            Thread.Sleep(2000);
            */

                #endregion //IE Handle

                //MessageBox.Show(Control.MousePosition.ToString());

                #region //Chrome Handle

                /*
            string chrom_path = @"C:\Users\Rahul Roy\AppData\Local\Google\Chrome\Application\chrome.exe";
            ExtProgramHandle chrome = new ExtProgramHandle(chrom_path, "Chrome_WidgetWin_1", "New Tab - Google Chrome");
            //MessageBox.Show(chrome.win_class + "   " + chrome.win_name + "   " + chrome.prog_path);
            //chrome.set_show_state(ShowState.SW_MINIMIZE);
            chrome.bring_to_ForeGround();
            chrome.p.Exited += new EventHandler(p_Exited);

            chrome.exitApplication();
            */

                #endregion //Chrome Handle

                #region //GUI MAIN APPLICATION

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                PXCMSession session = null;
                pxcmStatus sts = PXCMSession.CreateInstance(out session);

                if (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR)
                {
                    MainScreen mscreen = new MainScreen(session);
                    MainFormGR GR = new MainFormGR(session, mscreen);
                    MainFormVR VR = new MainFormVR(session, mscreen);
                    mscreen.binding(GR, VR);

                    JarvisMouse myMouse = new JarvisMouse(mscreen);
                    Thread mouse_worker = new Thread(myMouse.query_mouse);
                    mouse_worker.Start();
                    Application.Run(mscreen);
                    try
                    {

                        mouse_worker.Abort();
                        GR.Dispose();
                        VR.Dispose();
                        mscreen.Dispose();
                        session.Dispose();
                        Thread.Sleep(50);
                        Application.Exit();
                    }
                    catch (Exception i) {
                        Application.Exit();
                    }

                }

                #endregion //GUI MAIN APPLICATION
            }
            catch (Exception e)
            {
                //MessageBox.Show("ERROR - " + e.Message);
            }
        }
Exemplo n.º 2
0
        public MainFormGR(PXCMSession session, MainScreen mainScreen)
        {
            InitializeComponent();
            this.mainScreen = mainScreen;
            this.session = session;
            PopulateDeviceMenu();
            PopulateModuleMenu();
            FormClosing += new FormClosingEventHandler(MainForm_FormClosing);
            Panel2.Paint += new PaintEventHandler(Panel_Paint);

            timer.Tick += new EventHandler(timer_Tick);
            timer.Interval = 2000;
            timer.Start();

            pictures = new Hashtable();
            pictures[PXCMGesture.Gesture.Label.LABEL_HAND_CIRCLE] = Properties.Resources.circle;
            pictures[PXCMGesture.Gesture.Label.LABEL_HAND_WAVE] = Properties.Resources.wave;
            pictures[PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_DOWN] = Properties.Resources.swipe_down;
            pictures[PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_LEFT] = Properties.Resources.swipe_left;
            pictures[PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_RIGHT] = Properties.Resources.swipe_right;
            pictures[PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_UP] = Properties.Resources.swipe_up;
            pictures[PXCMGesture.Gesture.Label.LABEL_POSE_BIG5] = Properties.Resources.big5;
            pictures[PXCMGesture.Gesture.Label.LABEL_POSE_PEACE] = Properties.Resources.peace;
            pictures[PXCMGesture.Gesture.Label.LABEL_POSE_THUMB_DOWN] = Properties.Resources.thumb_down;
            pictures[PXCMGesture.Gesture.Label.LABEL_POSE_THUMB_UP] = Properties.Resources.thumb_up;
        }
Exemplo n.º 3
0
        public MainFormVR(PXCMSession session, MainScreen mainScreen)
        {
            InitializeComponent();
            this.mainScreen = mainScreen;
            this.session = session;

            try
            {
                PopulateSource();
                PopulateModule();
                PopulateLanguage();
                dictationToolStripMenuItem_Click(null, null);
            }
            catch (Exception e)
            {
                //MessageBox.Show("VR INIT NOT SUCCESSFUL");
            }

            Console2.AfterLabelEdit += new NodeLabelEditEventHandler(Console2_AfterLabelEdit);
            Console2.KeyDown += new KeyEventHandler(Console2_KeyDown);
            FormClosing += new FormClosingEventHandler(MainForm_FormClosing);
        }
Exemplo n.º 4
0
 public JarvisMouse(MainScreen mscreen)
 {
     mScreen = mscreen;
 }
Exemplo n.º 5
0
 public GestureRecognition(MainFormGR form,MainScreen mscreen)
 {
     this.form = form;
     this.mscreen = mscreen;
 }