473,378 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

how to implement automatic completion in c

Hi all,
How to implement automatic completion i.e, suppose
Assume that there are commands like

show
show version
show ip
show arp

As soon as you press "s" and tab it should display "show ".

Please any one help..
Thanks in advance.
Oct 1 '07 #1
3 1793
arnaudk
424 256MB
First of all, you'll need to detect when the TAB key which means you'll have to capture individual keyboard key presses. This is implementation-dependent. In Windows, use kbhit() or (for VC++) _kbhit(). In Linux, check out the ncurses library.
The way I see it, you'll have to make a loop which handles alphanumeric key presses by displaying them on the screen and storing them in a buffer (like the normal line input functions of C++ do), and detects TAB key presses, responding accordingly by completing the word on the screen and in the buffer. The loop should also detect when the Enter/Return key is pressed then exit.

Arnaud
Oct 1 '07 #2
Hey,
check out the bioskey(),first note the values for each key press and proceed
Oct 1 '07 #3
arnaudk
424 256MB
The bioskey() function is largely obsolete, it only works in older versions of Borland's Turbo C I think.

Arnaud
Oct 1 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: John | last post by:
Hi, Could you give your opinions on the best code completion in Python IDEs. My only complaint with PythonWin has been that the code completion support is incomplete. The interactive mode has...
2
by: michi | last post by:
Hello there. When I write any text in ASP.NET an annoying FONT TAG is always addes. Example: **************Default ASP.NET page after adding some text*********** <%@ Page Language="vb"...
1
by: theburnetts | last post by:
I have a complex class heirarchy where all of my classes inherit from a single base class (BaseObject) and this BaseObject class inherits from XPBaseObject. XPBaseObject is a 3rd party base class...
2
by: Denny | last post by:
I'm going from VB.net. Is there a way to have VS automatically add braces to methods? Also in VB, you do not need to add () for a method or function that does not need parameters. Is there a way...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.