Solved

Keyboard Work..(Misc)

Posted on 2000-02-28
4
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

734 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