Go to the first, previous, next, last section, table of contents.


__get_extended_key_string

Syntax

#include <pc.h>

const unsigned char * __get_extended_key_string(int xkey_code);

Description

Returns an ECMA-48 compliant representation of an extended key's scan code in xkey_code.

See section getkey. See section getxkey.

Return Value

A pointer to an ECMA-48 compliant string if the scan code xkey_code has an encoding or NULL if there is not.

Note that this function is DJGPP-specific.

Portability

not ANSI, not POSIX

Example

#include <pc.h>
#include <stdio.h>

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("<unknown>");
  }
  fflush(stdout);
}

#include <pc.h>
#include <stdio.h>
#include <dpmi.h>

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);
  }
}


Go to the first, previous, next, last section, table of contents.