scancode_to_ascii(3alleg)

scancode_to_ascii3alleg

Converts a scancode to an ascii character. allegro game programming library.

Usage

#include <allegro.h>

int scancode_to_ascii(int scancode);

Overview

Converts the given scancode to an ASCII character for that key (mangling Unicode values), returning the unshifted uncapslocked result of pressing the key, or zero if the key isn't a character-generating key or the lookup can't be done. The lookup cannot be done for keys like the F1-F12 keys or the cursor keys, and some drivers will only return approximate values. Generally, if you want to display the name of a key to the user, you should use the scancode_to_name function.

Example:

   int ascii;
   ...
   ascii = scancode_to_ascii(scancode);
   allegro_message("You pressed '%c'\n", ascii);

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.