Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
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:

C#
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

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900