예제 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            textBox2.Text = "";
            CopyPaster cp = new CopyPaster(wnd);

            cp.ReplaceLastWord();
        }
예제 #2
0
        IEnumerator UpdateCopyPaster()
        {
            cp = new CopyPaster(context, cfg);
            while (true)
            {
                if (!hasFocusedField())
                {
                    if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.C))
                    {
                        yield return(cp.CopyAll());

                        yield return(new WaitForSeconds(0.3f));
                    }
                    //Paste
                    else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.V))
                    {
                        yield return(cp.PasteAll(context.EditorManager.MusicPlayerWindow.CurrentTime));

                        yield return(new WaitForSecondsRealtime(0.75f));
                    }
                    //Special Paste
                    else if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.V))
                    {
                        yield return(cp.ShowSpecialPaste());

                        yield return(new WaitForSecondsRealtime(0.75f));
                    }
                }
                yield return(null);
            }
        }
예제 #3
0
        public void EntryPoint(bool isDown, ref bool isRun)
        {
            if (!Enable)
            {
                return;
            }
            var fWindow = SystemWindow.ForegroundWindow().FocusedWindow();

            if (!(fWindow.KeyboardLayout.Equals(new CultureInfo("ru-RU")) ||
                  fWindow.KeyboardLayout.Equals(new CultureInfo("en-US"))))
            {
                return;
            }
            var filter = SettingsLayer.GetWindowConfig(fWindow.ProcessName, fWindow.ClassName);

            if (filter.TextSwitchStatus == FilterConfig.TextSwitchMethod.Off ||
                filter.TextReplaceStatus == TextReplaceMethod.Off)
            {
                return;
            }
            if (SettingsLayer._copyPaster.NotUseClipboardForTextBoxAndRichTextBox)
            {
                foreach (
                    var word in fWindow.ClassName.Split(new char[] { ' ', '.' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    if (word.Equals("RichEdit20W", StringComparison.CurrentCultureIgnoreCase))
                    {
                        filter.TextReplaceStatus = TextReplaceMethod.RichTextBox;
                        break;
                    }
                    if (word.Equals("Edit", StringComparison.CurrentCultureIgnoreCase))
                    {
                        filter.TextReplaceStatus = TextReplaceMethod.TextBox;
                        break;
                    }
                    if (word.Equals("TEdit", StringComparison.CurrentCultureIgnoreCase))
                    {
                        filter.TextReplaceStatus = TextReplaceMethod.TextBox;
                        break;
                    }
                }
            }

            isRun = true;

            CopyPaster copyPaster = new CopyPaster(fWindow, filter.TextReplaceStatus);
            string     text       = "";

            copyPaster.BackupClipboard();
            if (copyPaster.CopyText(ref text))
            {
                if (!string.IsNullOrWhiteSpace(text))
                {
                    text = TextConverter(text, fWindow.KeyboardLayout);
                    copyPaster.PasteText(text);
                }
                copyPaster.RestoreClipboard();
            }
        }
예제 #4
0
        private void button3_Click(object sender, EventArgs e)
        {
            textBox2.Text = "";
            CopyPaster cp   = new CopyPaster(wnd);
            string     text = "";
            bool       res  = cp.CopyTextWmCopyPaste(ref text);

            textBox2.Text = res.ToString() + "\r\n" + text;
            text          = "{хаХа 159 vBn}";
            cp.PasteTextWmCopyPaste(text);
        }