1

I am trying to make a little "cheat" for a typing website, I want the program to:

  1. Open the Webbrowser and to open the site (done).
  2. Simulate "F12"-Key to open the Browser Console (not working).
  3. And then I want the program to type my "cheat" in the Browser console (JavaScript Code).

This is how far I got so far, apparently I cant even open the Browser Console, could someone help me out? :)

using System;
using System.Web;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using WindowsInput.Native;
using WindowsInput;


namespace AutomatingProcess
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
            var prs = new ProcessStartInfo(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe");
            prs.Arguments = "https://10fastfingers.com/typing-test/english";
            Process.Start(prs);
            Inject();
            Console.WriteLine("Press any key to start the hack...");
        }
        public static void Inject()
        {
            InputSimulator sim = new InputSimulator();
            sim.Keyboard.KeyPress(WindowsInput.Native.VirtualKeyCode.VK_F12);
        }
    }
}

My current error: 'VirtualKeyCode' does not contain a definition for 'VK_F12'. I really dont understand what im doing wrong.. for some weird reasons the other keys work like "VK_9" or "VK_SPACE".

Would greatly appreciate any help regarding the SimulateInput problem.

tryinghard45
  • 21
  • 1
  • 5
  • *I really dont understand what im doing wrong* you assume that this library is for simulating input to another process ... Maybe you should try selenium WebDriver – Selvin Jun 15 '20 at 13:08
  • Will have a look at Selenium, thank you! :) – tryinghard45 Jun 15 '20 at 13:10
  • Maybe, the following link helps: https://stackoverflow.com/questions/15292175/c-sharp-using-sendkey-function-to-send-a-key-to-another-application – luke Jun 15 '20 at 13:31

0 Answers0