Keil Logo


#include <stdio.h>

int _getkey ();

The _getkey function waits for a character to be received from the serial port.


  • This routine is implementation-specific and its function may deviate from that described above. Source code is provide in the LIB folder. You may modify the source to customize this function for your particular hardware environment.
Return Value

The _getkey routine returns the received character.

See Also

getchar, putchar, ungetchar

#include <stdio.h>

void test_getkey (void) {
  int c;

  while ((c = _getkey ()) != 0x1B) {
    printf ("key = %c %bu %bx\n", c, c, c);
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.