Solved

Keyboard Work..(Misc)

Posted on 2000-02-28
4
181 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
Comment Utility
 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
Comment Utility
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
Comment Utility
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
Comment Utility
"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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

744 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