answersLogoWhite

0

Retrieving keyboard input depends partly upon whether you're writing a console or graphical application. If you're writing a console application, you have the following functions available:

- sscanf() in the stdio.h header

- getchar() in the stdio.h header

- getch() in conio.h and curses.h (plus kbhit() if it's available)

For Win32 applications, which are event-driven, you'll want to intercept the WM_CHAR event that's passed to your window handler (WndProc). The wParam parameter will contain the character on the keyboard that's pressed.

For other APIs, you'll want to check the documentation, or look on the Web for tutorials describing how to get keyboard input using whichever API you're using.

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering