472,992 Members | 3,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

"paste" problem when reading user command from console

Hi all,

When I tried reading user command from console, I use "select" to wait
for user input in order to improve efficiency. But when it comes to
dealing with user pasting a command, there is a problem. Only the first
character of the pasted command can be displayed. But the command is
actually there, if you typed any one more key, the whole pasted command
will be displayed. Here is the code. Do you have any way to get through
this? Thanks.

while {
select_result = select (1, &read_fds, 0, 0 , NULL); // listen
for user input from stdin
// error handling for select function.
ch = getch();
printf("%c",ch);
}
Problem - when you paste a comand, e.g. activate, only the first
charcter 'a' is printed, and if you type any one more key, the whole
command "activate" will be printed.

Nov 29 '05 #1
1 1803

<ki********@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Hi all,

When I tried reading user command from console, I use "select" to wait
for user input in order to improve efficiency. But when it comes to
dealing with user pasting a command, there is a problem. Only the first
character of the pasted command can be displayed. But the command is
actually there, if you typed any one more key, the whole pasted command
will be displayed. Here is the code. Do you have any way to get through
this? Thanks.

while {
select_result = select (1, &read_fds, 0, 0 , NULL); // listen
for user input from stdin
// error handling for select function.
ch = getch();
printf("%c",ch);
}
Problem - when you paste a comand, e.g. activate, only the first
charcter 'a' is printed, and if you type any one more key, the whole
command "activate" will be printed.


Those look like platform-specific commands to me. You should ask in a
newsgroup devoted to your platform. Windows, perhaps?

-Howard


Nov 29 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: Alf P. Steinbach | last post by:
A few days ago I posted an "Hello, world!" tutorial, discussed in <url: http://groups.google.no/groups?threadm=41ba4c0a.76869078@news.individual.net>. As I wrote then: <quote> because there...
5
by: Add and Paste | last post by:
Dear Access developers, I have a lot of cut and pasting to do from Excel to an Access form. But instead of just pasting, I want to "add then paste" the value. Does anybody have a way to do this?...
1
by: Nicolas Verhaeghe | last post by:
I am overtired of having to right click and select "Paste as HTML" manually. Could it be possible to make this the default when doing Ctrl+V? Thanks a lot for your help!
2
by: yevron2 | last post by:
Hello, I am tring to write a clipboard spy that catches events from the clipboard. I used the SetClipboardViewer api to get events when data is copied into the clipboard, and also...
1
by: hartattack72 | last post by:
Hello. I am new to access, but have had great success in creating an application. My one user is requesting a function to save time in data entry... and I am stumped being the plebian that I am. ...
7
kcdoell
by: kcdoell | last post by:
Good morning everyone: I created a form and set the default view as a continuous form. Basically the form is displaying records in which the user can add or edit new ones. The record source for...
1
by: aeconsta | last post by:
I want to add images to my database by copying and pasting the image. I am using MS SQL Server Express 2008 and MS VB Express 2008. I want to create a simple program that displays data including...
3
by: Kappucino XL | last post by:
Hi There.. What is the Macro or Code Builder Event, For Copying And Pasting. i.e: I need to click on a field in a textbox, and it must be copied jus by clicking on it. Then I want to click on...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.