Click here to Skip to main content
14,492,338 members
Rate this:
Please Sign up or sign in to vote.
See more:
string sentence = "Mahesh Chand is a cool guy ";
            char[] charArr = sentence.ToCharArray();
            foreach (char ch in charArr)
            {

                Console.WriteLine(ch);
            }



                Console.WriteLine("!");


                InputSimulator sim = new InputSimulator();


                string yelp = Console.ReadLine();
                sim.Keyboard.KeyPress(VirtualKeyCode.VK_C);
               
       
                sim.Keyboard.KeyPress(VirtualKeyCode.VK_I);
         
                sim.Keyboard.KeyPress(VirtualKeyCode.VK_C);

              
        
               Console.WriteLine(yelp);


                //Console.ReadLine();

I just want the key that is outputtted to be taken from "ch" from the chr array
how would I do it? thanks

What I have tried:

sim.Keyboard.KeyPress(VirtualKeyCode.VK_(ch));
sim.Keyboard.KeyPress(VirtualKeyCode.VK_ch);

etc
ps yeah I understand its really simple just not really experience with this libary
Posted
Updated 19-Sep-19 12:48pm
v3

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

char ch = 'A';
Keys keys = (Keys) ch;
// etc.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100