Click here to Skip to main content
15,920,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Im working on this project for an internship and it requires me to stimulate keypress. That is, when I click, I need it to type data that was read from a text file without me using the keyboard.
Is this possible using sendkeys() or keybd_event?
I've been trying long to find a solution.

What I have tried:

This is a small part of a huge project, basically I have a UI, and when I click on the text box, I want it to automatically type in as read from a text file. I should not have to use the keyboard at all.
Posted
Updated 13-Jul-17 8:02am

Something like SendInput function[^]? that is if you are using Windows.
 
Share this answer
 
Have it automatically type in to the textbox? The final result will be the entire file - or however much you read - so why not just update the text-boxes value (for e.g, if in C++.net).

If you use a keypress simulation of actual typing, what will you do to slow it down so it all doesn't appear in an instant, just as though it were simply placed there all at once?

Analysis of the text box content can be done via onchange event (for example).

If not in .NET, you can use fgetc() to read/write in a loop, feeding them to the display.

Ultimately, what do you expect to see or do (since you mentioned it as part of a UI) that mandates simulating keypress input from file data? That would effect how to answer the question
 
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