Example #1
0
        public void mySendKeys()
        {
            if (InvokeRequired)
            {
                BeginInvoke(new VoidDelegate(mySendKeys));
            }
            else
            {
                try
                {
                    Global.KeysDisabled = true;
                    if (KeyFunctions.numToBackspace > 0)
                    {
                        SendKeys.Send(KeyFunctions.GetBackspaces());
                    }
                    SendKeys.Flush();

                    string o = KeyFunctions.getOutputString();
                    if (o != null && o != "")
                    {
                        SendKeys.Send(o);
                    }
                    Global.KeysDisabled = false;
                }
                catch (Exception e)
                {
                    Log.WriteLine("[WA] SendKeys Exception: " + e.Message + "\n\n" + e.StackTrace);
                }
            }
        }
Example #2
0
        private void tmrPreviewUpdate_Tick(object sender, EventArgs e)
        {
            int tk = Environment.TickCount;

            WriteWB(KeyFunctions.getPreviewString(txtPrint.Text, ""));

            if (Environment.TickCount - tk > 500)
            {
                WriteWB("Preview is disabled due to timeout (Greater than 100ms execution time)");
                tmrPreviewUpdate.Enabled = false;
            }
        }
Example #3
0
        public void MyKeyPressed(object sender, KeyPressEventArgs e)
        {
            if (Global.KeysDisabled || e == null)
            {
                return;
            }

            if (e.KeyChar == 22) // Ctrl+V
            {
                KeyFunctions.PasteKey();
                return;
            }

            if (KeyFunctions.addKey(e.KeyChar.ToString()))
            {
                System.Threading.Thread t = new System.Threading.Thread(mySendKeys);
                t.Start();
            }
        }