Solved

Keyboard Work..(Misc)

Posted on 2000-02-28
4
201 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

832 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