Ejemplo n.º 1
0
    private IEnumerator OnKeyComma()
    {
        yield return(null);

        input.MoveTextEnd(false);
        InputSimulator.SimulateKeyPress(VirtualKeyCode.OEM_COMMA);
    }
Ejemplo n.º 2
0
    private IEnumerator OnKeyDelete()
    {
        yield return(null);

        input.MoveTextEnd(false);
        InputSimulator.SimulateKeyPress(VirtualKeyCode.BACK);
    }
Ejemplo n.º 3
0
    private IEnumerator OnKeyZero()
    {
        yield return(null);

        input.MoveTextEnd(false);
        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_0);
    }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            var mySerial = new SerialPort();

            try
            {
                mySerial = MySerialPort();

                while (true)
                {
                    Thread.Sleep(3000);

                    var texto = mySerial.ReadExisting();


                    if (!string.IsNullOrEmpty(texto))
                    {
                        InputSimulator.SimulateTextEntry(texto);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
                    }
                }
            }

            catch (Exception e)
            {
                Console.WriteLine($"{e.Message} \nerro ocorrido na porta {mySerial.PortName}");
            }

            finally
            {
                mySerial.Close();
            }

            Console.ReadKey();
        }
Ejemplo n.º 5
0
        public static void SendKey(Keys key)
        {
            var liteKey       = key & ~(Keys.Alt | Keys.Control | Keys.Shift);
            var listModifiers = new List <VirtualKeyCode>();

            if (key.HasFlag(Keys.Shift))
            {
                listModifiers.Add(VirtualKeyCode.SHIFT);
            }
            if (key.HasFlag(Keys.Control))
            {
                listModifiers.Add(VirtualKeyCode.CONTROL);
            }
            if (key.HasFlag(Keys.Alt))
            {
                listModifiers.Add(VirtualKeyCode.MENU);
            }

            if (listModifiers.Count < 1)
            {
                InputSimulator.SimulateKeyPress((VirtualKeyCode)liteKey);
            }
            else
            {
                InputSimulator.SimulateModifiedKeyStroke(listModifiers, (VirtualKeyCode)liteKey);
            }
        }
Ejemplo n.º 6
0
        //...

        private static void Main(string[] args)
        {
            String path  = @"c:\temp\Password.txt";
            String oPass = File.ReadAllText(path);
            //String ProcWindow = "Logon - Winman Live";

            Process p = Process.Start(@"\\VS02\WinManV7\Live\WinMan.exe");

            p.WaitForInputIdle();
            IntPtr h = p.MainWindowHandle;

            while (p.MainWindowHandle == IntPtr.Zero)
            {
                System.Threading.Thread.Sleep(100);
            }

            if (Control.IsKeyLocked(Keys.CapsLock)) // Checks Capslock is on
            {
                InputSimulator.SimulateKeyDown(VirtualKeyCode.SHIFT);
                //ActivateApp("WinMan.exe");
                ActivateApp("Winman");
                //ActivateApp("Logon - Winman Live");
                InputSimulator.SimulateTextEntry(oPass);
                InputSimulator.SimulateKeyUp(VirtualKeyCode.SHIFT);
            }
            else
            {
                //ActivateApp("WinMan.exe");
                ActivateApp("Winman");
                //ActivateApp("Logon - Winman Live");
                InputSimulator.SimulateTextEntry(oPass);
            }
            InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
        }
Ejemplo n.º 7
0
    private IEnumerator OnKeyPeriod()
    {
        yield return(null);

        input.MoveTextEnd(false);
        InputSimulator.SimulateKeyPress(VirtualKeyCode.OEM_PERIOD);
    }
Ejemplo n.º 8
0
        private static void abrirFavoritos()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\heart.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.BROWSER_FAVORITES);
        }
Ejemplo n.º 9
0
        private static void play()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\button-play.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.MEDIA_PLAY_PAUSE);
        }
Ejemplo n.º 10
0
        public void KeyboardEvent(int code, bool shift)
        {
            switch ((Keyboard)code)
            {
            case Keyboard.KEYCODE_DELETE:
                InputSimulator.SimulateKeyPress(VirtualKeyCode.BACK);
                break;

            case Keyboard.KEYCODE_ENTER:
                InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
                break;

            case Keyboard.KEYCODE_ALT:
            case Keyboard.KEYCODE_CANCEL:
            case Keyboard.KEYCODE_DONE:
            case Keyboard.KEYCODE_MODE_CHANGE:
            case Keyboard.KEYCODE_SHIFT:
                break;

            default:
                string s = ((char)code).ToString();
                if (shift)
                {
                    s = s.ToUpper();
                }
                InputSimulator.SimulateTextEntry(s);
                break;
            }
        }
Ejemplo n.º 11
0
        private static void abrirEmail()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\mail.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.LAUNCH_MAIL);
        }
Ejemplo n.º 12
0
 public void sendpassword()
 {
     DecryptText(Properties.Settings.Default.pass);
     Clipboard.SetText(decry, TextDataFormat.Text);
     c_web.Paste();
     InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
 }
Ejemplo n.º 13
0
        private static void abrirHome()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\home.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.BROWSER_HOME);
        }
Ejemplo n.º 14
0
        private static void selecionar()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\music.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.LAUNCH_MEDIA_SELECT);
        }
Ejemplo n.º 15
0
 void OnCollisionEnter(Collision col)
 {
     hookRb.velocity = Vector3.zero;
     InputSimulator.SimulateKeyPress(VirtualKeyCode.SPACE);
     anchored = true;
     playerRb.collisionDetectionMode = CollisionDetectionMode.Continuous;
 }
Ejemplo n.º 16
0
        public bool SendSpecialkey(
            string keyName)
        {
            try
            {
                Trace.WriteLine(String.Format("{0} SendSpecialkey {1}", DateTime.Now.ToLongTimeString(), keyName));
                switch (keyName)
                {
                default:
                    return(false);

                case "ClearDesktop":
                    //  Minimize everything on the desktop - Windows-M
                    InputSimulator.SimulateModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_M);
                    return(true);

                case "ContextMenu":
                    //  Press the "context menu" key
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.APPS);
                    return(true);
                }
            }
            catch (System.Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 17
0
        /* Simulates the key pressed using InputSimulator.
         * cases:
         * 0=prev
         * 1=next
         * 2=res
         * 3=up
         * 4=down */
        private void KeySimulations(int Simulation)
        {
            switch (Simulation)
            {
            case 0:
                InputSimulator.SimulateKeyPress(VirtualKeyCode.MEDIA_PREV_TRACK);
                return;

            case 1:
                InputSimulator.SimulateKeyPress(VirtualKeyCode.MEDIA_NEXT_TRACK);
                return;

            case 2:
                InputSimulator.SimulateKeyPress(VirtualKeyCode.MEDIA_PLAY_PAUSE);
                return;

            case 3:
                InputSimulator.SimulateKeyPress(VirtualKeyCode.VOLUME_UP);
                return;

            case 4:
                InputSimulator.SimulateKeyPress(VirtualKeyCode.VOLUME_DOWN);
                return;
            }
        }
Ejemplo n.º 18
0
        private static void voltarMusica()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\button-rew.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.MEDIA_PREV_TRACK);
        }
Ejemplo n.º 19
0
        private static void abaixarVolume()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\speaker.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.VOLUME_DOWN);
        }
Ejemplo n.º 20
0
        private static void avancarPagina()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\navigation-right.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.BROWSER_FORWARD);
        }
Ejemplo n.º 21
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetAxis("Event") > 0)
     {
         InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_X);
     }
 }
Ejemplo n.º 22
0
        private static void pesquisar()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\search.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.BROWSER_SEARCH);
        }
Ejemplo n.º 23
0
        private static void voltarPagina()
        {
            MessageForm frm = new MessageForm("img\\basic\\blue\\navigation-left.png", true);

            frm.Show();
            InputSimulator.SimulateKeyPress(VirtualKeyCode.BROWSER_BACK);
        }
Ejemplo n.º 24
0
        public void Action(string action)
        {
            /* Esque Enter  Rome  Endi  Peige daum  Peige ãpi  Tabi  printi iscrim  colar  copiar  recortar */
            switch (action.ToLower())
            {
            case "esque":
                InputSimulator.SimulateKeyPress(VirtualKeyCode.ESCAPE);
                break;

            case "enter":
                InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
                break;

            case "rome":
                InputSimulator.SimulateKeyPress(VirtualKeyCode.HOME);
                break;

            case "endi":
                InputSimulator.SimulateKeyPress(VirtualKeyCode.END);
                break;

            case "peige_daum":
                InputSimulator.SimulateKeyPress(VirtualKeyCode.NEXT);
                break;

            case "peige_ãpi":
                InputSimulator.SimulateKeyPress(VirtualKeyCode.PRIOR);
                break;

            case "tabi":
                InputSimulator.SimulateKeyPress(VirtualKeyCode.TAB);
                break;

            case "printi_iscrim":
                InputSimulator.SimulateKeyPress(VirtualKeyCode.SNAPSHOT);
                break;

            case "colar":
                InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL);
                InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_V);
                InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL);
                break;

            case "copiar":
                InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL);
                InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_C);
                InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL);
                break;

            case "recortar":
                InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL);
                InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_X);
                InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 25
0
 public override void Press()
 {
     InputSimulator.SimulateKeyPress(_keyCode);
     //var _myKeyCode = ToMySimulatorKeyCode(_keyCode);
     //if(_myKeyCode!= WindowsInputSimulator.Native.VirtualKeyCode.EMPTY)
     //    sim.Keyboard.KeyPress(_myKeyCode);
     base.Press();
 }
Ejemplo n.º 26
0
 public void VolumeUp_Spotify()
 {
     SwitchWindow_toSpotify();
     InputSimulator.SimulateKeyDown(VirtualKeyCode.LCONTROL);
     InputSimulator.SimulateKeyPress(VirtualKeyCode.UP);
     Thread.Sleep(500);
     InputSimulator.SimulateKeyUp(VirtualKeyCode.LCONTROL);
 }
Ejemplo n.º 27
0
 void OnDisable()
 {
     Key.keyPressed -= ShiftKeyPressed;
     if (!shiftToggle)
     {
         InputSimulator.SimulateKeyPress(VirtualKeyCode.CAPITAL);
     }
 }
Ejemplo n.º 28
0
 public void ContinuePlaySpotify()
 {
     if (flag_spotifystart == false)
     {
         flag_spotifystart = true;
         SwitchWindow_toSpotify();
         InputSimulator.SimulateKeyPress(VirtualKeyCode.SPACE);
     }
 }
Ejemplo n.º 29
0
 public void gestureOccurs(GestureEvent e)
 {
     if (lookup.ContainsKey(e.GetType()))
     {
         WindowsInput.VirtualKeyCode ekey = lookup[e.GetType()];
         //InputSimulator.SimulateModifiedKeyStroke(VirtualKeyCode.RMENU, ekey);
         InputSimulator.SimulateKeyPress(ekey);
     }
 }
Ejemplo n.º 30
0
 private void dgEmp_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         e.Handled = true;
         InputSimulator.SimulateKeyPress(VirtualKeyCode.F2);
         //    var dataGrid = sender as DataGrid;
         //    if (dataGrid != null) dataGrid.BeginEdit();
     }
 }