예제 #1
0
        /*
         * Major event handlers
         */

        /// <summary>
        /// Mouse event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Event_mouse(object sender, EventArgs e)
        {
            // Do not run if user has not pressed run button
            if (!Settings.flag_run || !Settings.flag_runRightClick)
            {
                return;
            }
            // Only run if "Path of Exile" is the main focused window
            if (WindowDiscovery.GetActiveWindowTitle() != Settings.activeWindowTitle)
            {
                return;
            }

            // Send Ctrl+C on mouse click
            KeyEmulator.SendCtrlC();
        }
예제 #2
0
        /// <summary>
        /// Clipboard event handler
        /// </summary>
        private void Event_clipboard(object sender, EventArgs e)
        {
            // Do not run if user has not pressed run button
            if (!Settings.flag_run && !Settings.flag_runRightClick)
            {
                return;
            }
            // Only run if "Path of Exile" is the main focused window
            if (WindowDiscovery.GetActiveWindowTitle() != Settings.activeWindowTitle)
            {
                return;
            }
            // At this point there should be text in the clipboard
            if (!Clipboard.ContainsText())
            {
                return;
            }

            // TODO: check limits
            // Sleep to allow clipboard write action to finish
            Thread.Sleep(4);

            // Get clipboard contents
            string clipboardString = Clipboard.GetText();

            // Since this event handles *all* clipboard events AND we put the buyout note in the clipboard
            // then this event will also fire when we do that. So, to prevent an infinte loop, this is needed
            if (clipboardString.Contains("~b/o ") || clipboardString.Contains("~price "))
            {
                Task.Run(() => ClipBoard_NotePasteTask());
            }
            else
            {
                Task.Run(() => ClipBoard_ItemParseTask(clipboardString));
            }
        }