Sponsored Content
Top Forums Programming Detecting Keyboard Input without return Post 302117036 by Perderabo on Thursday 10th of May 2007 07:58:00 AM
Old 05-10-2007
Quote:
Originally Posted by ravneetd
I looked up the termios library function which you have suggested.
We have a search function on this site. Look what I found when I tried searching for "termios".
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

suppressing keyboard input

Setup Info: This User Id and Password mention below are being used with the ISQL command to connect to a sybase database so they are likely to not be the same as those that were signed on from the session. Situation: Using a korn shell, the shell prompts for a User Id and Password. During the... (1 Reply)
Discussion started by: anthreedhr
1 Replies

2. Programming

Keyboard Input

Does anyone know how do you determine the user idle time of STDIN in order to log the user out for being idle too long. I would like to write a c program to do this but I it is not clear upon how to determine idle time from keyboard input. I have found that the "who.c" source file uses the last... (4 Replies)
Discussion started by: cpaquette
4 Replies

3. Programming

Detecting if command is waiting for input

Hi, After doing a fork and executing a shell, we execute (third party) commands which are essentially non-interactive. But some of them ask for input, under some (unforeseeable) circumstances. When this happens we go on waiting for output. Their is timeout, of course, but we don't seem to know... (5 Replies)
Discussion started by: slash_blog
5 Replies

4. UNIX for Dummies Questions & Answers

Testing for correct user input from keyboard

What script can I use to catch errors in a shell script if user inputs alpha numeric characters instead on integers from the keyboard? (0 Replies)
Discussion started by: Pauline mugisha
0 Replies

5. Shell Programming and Scripting

Keyboard input question

How would I change up a script that currently has something like: bash script echo what's 1 2 3 4? then using read 1 2 3 4 I type 1 2 3 4. so in the script i can do stuff like echo $1 $2 $3 $4 and such... i was just doing echo "1 2 3 4"|bash script But was wondering how could I... (5 Replies)
Discussion started by: biopulse
5 Replies

6. Shell Programming and Scripting

sed execution with input from keyboard

> sed '' Hello hi Hello output How hi output ^D How > sed should take each line as input, process and output the result. In the above scenario the input is passed from keyboard and the output of 'Hello' as you can see is displayed on the screen after 'hi' is passed as input but not as... (1 Reply)
Discussion started by: loggedin.ksh
1 Replies

7. Shell Programming and Scripting

Input keyboard keys upon program launch

Hey guys, first post! I want to write a script that will wait 1 second and then input the keys CTRL+ALT+J to the application i just opened. The program is dosbox, and thay key combination starts video recording :) I have no idea how to program this, can anyone help please? thanks in advance! (2 Replies)
Discussion started by: brunobliss
2 Replies

8. Shell Programming and Scripting

How to get input from keyboard with watch?

Hello, i`m trying to create an network monitoring script and i dont know how to make affect that script by pressing an key from keyboard and that script runs not in while or for or any other loop, but with bash command watch for example: i have created an file (for example check) with content... (0 Replies)
Discussion started by: bacarrdy
0 Replies

9. Shell Programming and Scripting

Read input from Keyboard, do not proceed if no input

Hi, I am working on a script, which requests users to enter input. Ex: read -p "Please enter your email id:" email I don't want users skipping this entry, this has to be mandatory.I dont want to proceed without input. I can do a check if variable $email is empty and proceed if not.But, i... (7 Replies)
Discussion started by: aravindadla
7 Replies

10. Programming

Simple capturing of keyboard input without interruption

I would like to make a function or command that checks for keyboard input without interrupting the program and exits the program when a key is pressed (perhaps the 'q' key). The program below monitors and prints/executes commands upon a change in primary (mouse selection) or clipboard buffer. If... (4 Replies)
Discussion started by: bedtime
4 Replies
getch(3cur)															       getch(3cur)

Name
       getch, mvgetch, mvwgetch, wgetch - read character

Syntax
       #include <cursesX.h>

       int getch()

       int wgetch(win)
       WINDOW *win;

       int mvgetch(y, x)
       int y, x;

       int mvwgetch(win, y, x)
       WINDOW *win;
       int y, x;

Description
       The routine reads a character from the terminal associated with the default window.

       The routine reads a character from the terminal associated with the specified window.

       The routine reads a character from the terminal associated with the default window at the specified position.

       The routine reads a character from the terminal associated with the specified window at the specified position.

       The  following information applies to all the routines.	In mode, if there is no input waiting, the integer is returned.  In mode, the pro-
       gram waits until the system passes text through to the program.	Usually the program will restart after one character or  after	the  first
       newline, but this depends on how is set.  The character will be echoed on the designated window unless has been set.

       If is and a function key is pressed, the token for that function key is returned instead of the raw characters.	Possible function keys are
       defined in the header file with integers beginning with 0401.  The function key names begin with KEY_.  Function keys and their	respective
       integer values are described in the Guide to X/Open Curses Screen-Handling (R)

       If  a character is received that could be the beginning of a function key (such as escape), sets a timer.  If the remainder of the sequence
       does not come within the designated time, the character will be passed through, otherwise the  function	key  value  is	returned.   Conse-
       quently, there may be a delay after a user presses the escape key before the escape is returned to the program.

       Using the escape key for a single character function is discouraged.

       The routines and are macros.

Return Values
       Upon successful completion, the and functions return the character read.

       If in delay mode and no data is available, ERR is returned.

See Also
       cbreak(3cur), keypad(3cur), nodelay(3cur), noecho(3cur)
       Guide to X/Open Curses Screen-Handling

																       getch(3cur)
All times are GMT -4. The time now is 08:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy