From: "Mark E." To: djgpp-workers AT delorie DOT com Date: Wed, 25 Jul 2001 00:13:35 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: extended key string docs Message-ID: <3B5E0F2F.14861.65A457@localhost> X-mailer: Pegasus Mail for Win32 (v3.12c) Reply-To: djgpp-workers AT delorie DOT com How's this? @node __get_extended_key_string, bios @subheading Syntax @example #include const unsigned char * __get_extended_key_string(int key_code); @end example @subheading Description Returns an @sc{ecma}-48 compliant representation of an extended key's scan code in @var{key_code}. @xref{getkey}. @xref{getxkey}. @subheading Return Value A pointer to an @sc{ecma}-48 compliant string if one is associated with the scan code @var{key_code} or @code{NULL} if there is not. @subheading Portability @port-note This function is DJGPP-specific. @portability !ansi, !posix @subheading Example @example #include #include int key; int main() @{ key = getxkey(); if (key < 0x100) @{ putc(key, stdout); putc('\r', stdout); @} else @{ const unsigned char *str = __get_extended_key_string(key); if (str) puts(str); else puts(""); @} fflush(stdout); @} @end example @example #include #include #include int main() @{ __dpmi_regs r; const unsigned char *str; int is_extended_key; /* Wait for keypress. */ r.h.ah = 0x11; __dpmi_int(0x16, &r); /* Print the encoding for function keys (F1, F2, etc.) and other extended keys (Home, End, etc.). */ is_extended_key = (r.h.al == 0x00 || r.h.al == 0xe0); if (is_extended_key) @{ str = __get_extended_key_string((int)r.h.ah) printf("Key encoding: %s", str); @} @} @end example