Skip to content
Snippets Groups Projects
Commit dd4a882b authored by Thierno souleymane Bah's avatar Thierno souleymane Bah
Browse files

keyboard mapping header functions added

parent 47eae902
No related branches found
No related tags found
No related merge requests found
#if !defined(KEYBOARD_H)
#define KEYBOARD_H
#define NONE 0
#define SHIFT_UP 0x2A
#define SHIFT_DOWN 0xAA
#define NB_KEYS 256
typedef enum boolean
{
FALSE,
TRUE
} boolean_t;
static boolean_t shift_pressed;
typedef struct key_s
{
unsigned char bottom;
unsigned char top;
} key_t;
key_t KEY_MAPPING[NB_KEYS];
void init_keymapping();
char keyboard_map(unsigned char code);
// KEY_MAPPING[0x1E][0] = 'a';
// kb_mapping[0x1E][1] = 'A';
// kb_mapping[0x30] = ['b', 'B'];
// kb_mapping[0x2E] = ['c', 'C'];
// kb_mapping[0x20] = ['d', 'D'];
// kb_mapping[0x12] = ['e', 'E'];
// kb_mapping[0x21] = ['f', 'F'];
// kb_mapping[0x22] = ['g', 'G'];
// kb_mapping[0x23] = ['h', 'H'];
// kb_mapping[0x17] = ['i', 'I'];
// kb_mapping[0x24] = ['j', 'J'];
// kb_mapping[0x25] = ['k', 'K'];
// kb_mapping[0x26] = ['l', 'L'];
// kb_mapping[0x32] = ['m', 'M'];
// kb_mapping[0x31] = ['n', 'N'];
// kb_mapping[0x18] = ['o', 'O'];
// kb_mapping[0x19] = ['p', 'P'];
// kb_mapping[0x10] = ['q', 'Q'];
// kb_mapping[0x13] = ['r', 'R'];
// kb_mapping[0x1F] = ['s', 'S'];
// kb_mapping[0x14] = ['t', 'T'];
// kb_mapping[0x16] = ['u', 'U'];
// kb_mapping[0x2F] = ['v', 'V'];
// kb_mapping[0x11] = ['w', 'W'];
// kb_mapping[0x2D] = ['x', 'X'];
// kb_mapping[0x15] = ['y', 'Y'];
// kb_mapping[0x2C] = ['z', 'Z'];
// kb_mapping[0x39] = [' ', ' ']; // espace
/*
char chars[26][2] = {
{'a', 'A'],
{'z', 'Z'},
{'e', 'E'},
{'r', 'R'},
{'t', 'T'},
{'y', 'Y'},
{'u', 'U'},
{'i', 'I'},
{'o', 'O'},
{'p', 'P'},
{'q', 'Q'},
{'s', 'S'},
{'d', 'D'},
{'f', 'F'},
{'g', 'G'},
{'h', 'H'},
{'j', 'J'},
{'k', 'K'},
{'l', 'L'},
{'m', 'M'},
{'w', 'W'},
{'x', 'X'},
{'c', 'C'},
{'v', 'V'},
{'b', 'B'},
{'n', 'N'}};
char codes[26] = {
0x10,
0x11,
0x12,
0x13,
0x14,
0x15,
0x16,
0x17,
0x18,
0x19,
0x1e,
0x1f,
0x20,
0x21,
0x22,
0x23,
0x24,
0x25,
0x26,
0x27,
0x2c,
0x2d,
0x2e,
0x2f,
0x30,
0x31}
*/
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment