Ce programme montre comment il est possible de récupéré les caractères accentués provenant d'une entree clavier.
#include <stdlib.h>
int main(int argc, char *argv[]){
int unicode;
char* text;
int width, height;
width = 640;
height = 480;
"medium - 9 - keyboard accents", "keyboard accents", width, height
);
10, 10,
"Vous pouvez faire apparaitre les caractères accentué !",
);
while( touche != MLV_KEYBOARD_ESCAPE ){
free( text );
}
return 0;
}
void MLV_create_window(const char *window_name, const char *icone_name, unsigned int width, unsigned int height)
Créé une fenêtre dont la taille, et les différents noms sont passés en paramètres.
void MLV_draw_filled_rectangle(int x, int y, int width, int height, MLV_Color color)
Dessine un rectangle plein dont la taille, la couleur et la position du sommet Nord-Ouest sont donnée...
void MLV_draw_text(int x, int y, const char *text, MLV_Color color,...)
Imprime un texte donné à une position et une couleur données.
char * MLV_convert_unicode_to_string(int unicode)
Transforme un caractère en format unicode en chaîne de caractères compatible avec le codage local (co...
void MLV_wait_keyboard(MLV_Keyboard_button *sym, MLV_Keyboard_modifier *mod, int *unicode)
Suspend l'exécution jusqu'à ce que l'utilisateur appuie sur une touche du clavier.