Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     RamGecTools.MouseHook MouseHook = new RamGecTools.MouseHook();
     MouseHook.Install();
     MouseHook.LeftButtonDown += MouseHook_LeftButtonDown;
 }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //mouseHook.LeftButtonDown += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_LeftButtonDown);
            //mouseHook.RightButtonDown += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_RightButtonDown);
            mouseHook.MouseMove += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MouseMove);
            mouseHook.Install();

            keyboardHook.KeyDown += new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyDown);
            keyboardHook.KeyUp   += new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyUp);
            keyboardHook.Install();
        }
Ejemplo n.º 3
0
        public Poze()
        {
            civDoc = CivilApplication.ActiveDocument;
            db     = acadDoc.Database;
            ed     = acadDoc.Editor;
            //trans = db.TransactionManager.StartTransaction();
            using (trans = db.TransactionManager.StartTransaction())
            {
                idAxuri = civDoc.GetAlignmentIds();
                InitializeComponent();
                imagini      = new SortedDictionary <int, string>();
                imaginiCheie = new SortedDictionary <int, string>();
                listaFisiere = new List <string>();

                ActualizeazaAxuri();
                //comboBoxAx.SelectedIndex = 0;

                RegAppTable rat = (RegAppTable)trans.GetObject(db.RegAppTableId, OpenMode.ForWrite, false);
                if (!rat.Has("OVIDIU"))
                {
                    //rat.UpgradeOpen();
                    RegAppTableRecord ratr = new RegAppTableRecord();
                    ratr.Name = "OVIDIU";
                    rat.Add(ratr);
                    trans.AddNewlyCreatedDBObject(ratr, true);
                }
                trans.Commit();
            }

            //Instalare carlig pentru soarece
            MH.RightButtonDown += MH_RightButtonDown;
            MH.LeftButtonDown  += MH_LeftButtonDown;
            if (checkBoxSincr.Checked)
            {
                MH.Install();
            }

            //HookManager.MouseClick += HookManager_MouseClick;
            //SelectieDirector();
            //AfisarePoze();
        }
Ejemplo n.º 4
0
 private void InstallMouseAndKeyboard()
 {
     //Insatllo keyboard
     keyboardHook.KeyPress += new RamGecTools.KeyboardHook.myKeyboardHookCallback(keyboardHook_KeyPress);
     //Questo qui sotto era un vecchio handler che usavo per i problemi degli shortcut, momentaneamente lascio commentato
     //keyboardHook.HotKeyPress += new RamGecTools.KeyboardHook.myKeyboardHotkeyCallback(keyboardHook_HotKeyPress);
     keyboardHook.Install();
     //Installo Mouse
     mouseHook.MouseEvent += new RamGecTools.MouseHook.myMouseHookCallback(mouseHook_MouseEvent);
     mouseHook.Install();
     this.MouseWheel += MouseWheelEventHandler;
 }
Ejemplo n.º 5
0
        public ContextMenu()
        {
            InitializeComponent();
            FormBorderStyle = FormBorderStyle.None;
            ShowInTaskbar   = false;
            BackColor       = Color.Tan;
            Size            = new Size(200, 200);
            Shown          += ContextMenu_Shown;

            RamGecTools.MouseHook mouseHook = new RamGecTools.MouseHook();
            mouseHook.LeftButtonDown += MouseHook_LeftButtonDown;
            mouseHook.Install();

            InitializeControls();
        }
Ejemplo n.º 6
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            btnStartStop.Enabled = false;
            btnStartStop.Text    = "Start";

            mouseHook = new RamGecTools.MouseHook();
            mouseHook.LeftButtonDown += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_LeftButtonDown);
            mouseHook.LeftButtonUp   += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_LeftButtonUp);

            if (!HookEnabled)
            {
                HookEnabled = true;
                mouseHook.Install();
            }

            wndPinballBrowser = IntPtr.Zero;
        }
Ejemplo n.º 7
0
        private void btnStartStop_Click(object sender, EventArgs e)
        {
            if (!HookEnabled)
            {
                // Start capturing
                btnStartStop.Text = "Stop";
                HookEnabled       = true;
                mouseHook.Install();

                btnSave.Enabled = true;

                Import();
            }
            else
            {
                // Stop capturing
                btnStartStop.Text = "Start";
                HookEnabled       = false;
                mouseHook.Uninstall();
            }
        }
Ejemplo n.º 8
0
        private void mouseHookBox_CheckedChanged(object sender, EventArgs e)
        {
            if (mouseHookBox.Checked)
            {
                mouseGroup.Enabled = true;

                // register events
                mouseHook.MouseMove        += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MouseMove);
                mouseHook.LeftButtonDown   += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_LeftButtonDown);
                mouseHook.LeftButtonUp     += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_LeftButtonUp);
                mouseHook.RightButtonDown  += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_RightButtonDown);
                mouseHook.RightButtonUp    += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_RightButtonUp);
                mouseHook.MiddleButtonDown += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MiddleButtonDown);
                mouseHook.MiddleButtonUp   += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MiddleButtonUp);
                mouseHook.MouseWheel       += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MouseWheel);

                mouseHook.Install();
            }
            else
            {
                mouseGroup.Enabled = false;
                mouseHook.Uninstall();
            }
        }
Ejemplo n.º 9
0
Archivo: Form1.cs Proyecto: tetla/KCSS
        private void runMouseHook()
        {
            mouseHook.RightButtonDown += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_RightButtonDown);

            mouseHook.Install();
        }
Ejemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            m_oWorker.RunWorkerAsync();
            mouseHook.MouseMove        += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MouseMove);
            mouseHook.LeftButtonDown   += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_LeftButtonDown);
            mouseHook.LeftButtonUp     += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_LeftButtonUp);
            mouseHook.RightButtonDown  += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_RightButtonDown);
            mouseHook.RightButtonUp    += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_RightButtonUp);
            mouseHook.MiddleButtonDown += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MiddleButtonDown);
            mouseHook.MiddleButtonUp   += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MiddleButtonUp);
            mouseHook.MouseWheel       += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MouseWheel);

            mouseHook.Install();
            //ChangeCursor(@"%SystemRoot%\cursors\RadarPrecision.cur");

            /************************************************************
            *                  Get Desktop
            ************************************************************/
            g_desktop = Graphics.FromHdc(desktop);

            /************************************************************
            *                 Global point
            ************************************************************/
            //win32.Win32.POINT pos = new win32.Win32.POINT();
            //pos.x = 0;
            //pos.y = 0;
            //win32.Win32.ClientToScreen(desktop, ref pos);
            //win32.Win32.SetCursorPos(pos.x, pos.y);

            /************************************************************
            *                 KeyBoard Hook
            ************************************************************/
            keyboardHook.KeyDown += new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyDown);
            keyboardHook.KeyUp   += new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyUp);

            keyboardHook.Install();

            /************************************************************
            *                  Serial port
            ************************************************************/
            Serial_Port = new SerialPort();
            if (Serial_Port.IsOpen)
            {
                Serial_Port.Close();
            }
            Serial_Port.PortName = "COM3";
            Serial_Port.BaudRate = 9600;
            Serial_Port.DataBits = 8;
            Serial_Port.Parity   = Parity.None;
            Serial_Port.StopBits = StopBits.One;
            try
            {
                Serial_Port.Open();
                //Serial_Port.Write("AT");
                //Thread.Sleep(1000);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            try
            {
                Serial_Port.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }