Solved

Keyboard Work..(Misc)

Posted on 2000-02-28
4
192 Views
Last Modified: 2010-04-02
Hello,

When we press any key present in the keyboard, for ex(Enter key), it is echoed on the screen.  Is it possible to do the same work with any kind of code/functions prebuilt. If so, please help me. thanks

--gsbabu
0
Comment
Question by:gsbabu
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Binder
ID: 2566313
 Sorry, I don´t understand what you want to do. Do you
want to build a library of keyboard functions? What is your O.S.?
0
 
LVL 22

Expert Comment

by:nietod
ID: 2566361
Standard C++ doesn't allow for this.  all input is echoed and line buffered (the user has to presse enter before your program gets the input.

But many compilers provide non-stnadard functions that will allow you to obtain input without line buffering and/or echoing.  So what compiler are you using?   You might try looking for a function called KeyPressed() and one called ReadKey(), which I beleive were used by Borland compilers for the Mac.
0
 

Author Comment

by:gsbabu
ID: 2566382
Hi

i am using gcc on solaris 2.6. more helps/suggesstions appreciated.

-gsbabu
0
 
LVL 22

Accepted Solution

by:
nietod earned 65 total points
ID: 2566474
"Misc"?  I thought you said "Mac"

for unix, you want to use the curses library.  This is a library of functions for controling the keyboard input and display output.  It has features for performing input without echoing and without line buffering and features for controlling the display, like moving the cursor and hiding the cursor etc.

You will need to include the curses.h file and link to the curses.o (right extension?) library.  This is all documented in your man pages.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now