| Otto Wyss 2004-09-26, 5:55 pm |
| In my little check app I'd like to read from the keyboard and the mouse
device and echo the input to the screen. I've never done this so I'd
appreciate if someone could scratch some code for the following two
tasks, more or less just looping and echoing input until the user waits
for 5 sec or presses RETURN twice. Since I don't have to look up
something you most probably already know it will help my OpenSource
development considerably. It doesn't have to very high sophisticated,
after all its just a check app.
// enter text
printf (_T("\n"
"Now enter any text, it should be echoed on the screen.
If you don't \n"
"see anything, the test will stop after pausing for at
least 5 sec. \n"
"To end the test press the RETURN key twice. \n"));
sleep (2);
while (???) {
???
}
// move mouse, press buttons
printf (_T("\n"
"Now move the mouse around or press any button. Each
2pixels movment in x-\n"
"direction will be echoed by an 'x' char (negative
direction by an 'X'), \n"
"y-direction will be echoed by an 'y' char (negative by
an 'Y'). Pressing \n"
"the left mouse button will be echoed by an 'L', middle
by an 'M', rigth \n"
"by an 'R'. If you don't see anything, the test will stop
after pausing \n"
"for at least 5 sec. To end the test press the RETURN key
twice. \n"));
sleep (2);
while (???) {
???
}
The full source is here
"http://cvs.sourceforge.net/viewcvs.py/wyodesktop/wyoDesktop/checkdfb/sr
c/app.cpp?view=markup". Thanks for any help.
O. Wyss
--
See a huge pile of work at "http://wyodesktop.sourceforge.net/"
|