Page 1 of 1

scancodes to ascii, const char declaration

Posted: Wed Apr 02, 2003 12:00 am
by OSNewbie
in my keyboard isr, i want to convert scan codes to ascii characters, so i have a line:

const char SCAN2ASCII[128] = "\0\01234567890-= .... fills up 128 bytes ... ";

well anyway, is there some way to make the second byte (the second \0) 27 or any byte value? what is the syntax for doing that? i mean, i want the bytes of SCAN2ASCII to be like this: 0, 27, '1', '2', '3', ... but i dont know how to insert a value of 27...

thanks

RE:scancodes to ascii, const char declaration

Posted: Thu Apr 03, 2003 12:00 am
by uri
try something like this:

const char SCAN2ASCII[128] = {'\0', 27, '1', '2', .....  };