Read/write from keyboard and mouse device
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Read/write from keyboard and mouse device




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Read/write from keyboard and mouse device  
Otto Wyss


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-26-04 10: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/"





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:03 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register