#include <windom.h>
#include <scancode.h> /* definition of keyboard scancodes */
void ex_keybd( WINDOW *win) {
char key = keybd2ascii( evnt.keybd, evnt.mkstate & (K_LSHIFT|K_RSHIFT));
switch( key) {
case 'w':
case 'W':
/* key w */
if( evnt.mkstate & K_CTRL)
; /* key Control-w */
break;
/* ... */
default:
/* Some keys have no ascii code (function key, numeric pad, ...).
* These keys can be identified by their scancode.
*/
switch( evnt.keybd>>8) {
case SC_HELP:
/* HELP key */
break;
/* ... */
}
}
}