Can anyone help me. I want to know how I can write a program which will have the same effect on my computer as pressing keys on the keyboard. For example, if I want the program to get the pointer to select the fourth, seventh and twelvth line in any text on the screen. Instead of manually selecting the lines each time I just run my program and it does this automatically? Basically a program that can repeat any sequence of keyboard commands that has been set.
Pressing a key usually calls a particular section of code in the program. Most of the time, the answer to a question like this is, you don't simulate the keyboard, you just call the code that particular keypress would cause to execute.
Thank you for your reply Rukbat. How would I find out which key presses call up which code lines and how would I call that code and execute it without pressing the key, would this work for mouse movement and left/right clicks as well?
Thanks a lot for your reply Rukbat, Can you recommend a language that has a lot of predefined commands which can be used to simulate keyboard presses and mouse movement? It would be better if the language was opensource.
Sorry, no, that's not how programming works. You have to write the commands - in any programming language.