need help on direct keyboard input 
Author Message
 need help on direct keyboard input

Hi,expert:
  I used programing in Basic language, there is a function name "
  inkey$", it will get one character from keyboard and do something.
  now, I would like to make a similar function in C, I try getchar()
  read() and other input function. they won't process the input unless
  you press Enter on you keyboard, is there somebody know how can
  program it in C?

  Thank you for any suggestion

  song

--
--------------------------------    ,-. __ .-,  -------------------

McGill University                 / (  ^__^  )  Tel: (514) 496-8010(o)
Montreal, Quebec  H3Z 2P8       ~`-..._)))(((.'                    
--------------------------------                -------------------



Fri, 17 Jul 1998 03:00:00 GMT  
 need help on direct keyboard input

Quote:

>Hi,expert:
>  I used programing in Basic language, there is a function name "
>  inkey$", it will get one character from keyboard and do something.
>  now, I would like to make a similar function in C, I try getchar()
>  read() and other input function. they won't process the input unless
>  you press Enter on you keyboard, is there somebody know how can
>  program it in C?

>  Thank you for any suggestion

        The C language does not support anything specific for that type
        of input.  Each o/s has a specific solution for this. For DOS
        platforms, you can use the non-ANSI function getch() which
        should be available in all DOS compilers.  You might also want
        to look at kbhit(). However, your code will not be portable to
        other platforms.
--

Airborne Geophysics
Geological Survey of Canada, Ottawa


Sat, 18 Jul 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help needed with keyboard input and console output

2. Keyboard input help: replacement for getch() - windows.h help

3. Need to know whether the focus window will ignore keyboard input

4. Help with keyboard input

5. Help! Checking for keyboard input in multitasking environment

6. Help ! Non Blocking Keyboard Input for Unix

7. Newbie help with keyboard input

8. keyboard input help

9. help: keyboard input

10. Newbie help with keyboard input

11. Need Help with Direct Sound

12. Direct keyboard access in C++ (for DOS).

 

 
Powered by phpBB® Forum Software