Mapping for first letter row

This commit is contained in:
Dejvino 2023-04-02 10:27:48 +02:00
parent 42c2cb60df
commit 885a391c84

View File

@ -140,10 +140,78 @@ void onSlaveClockInterrupt() {
}
void setupKeyMapping() {
m[0] = 0;
m[223] = ' ';
// top letter row
m[246] = '\t';
m[142] = 'q';
m[136] = 'w';
m[154] = 'e';
m[141] = 'r';
m[139] = 't';
m[134] = 'y';
m[138] = 'u';
m[150] = 'i';
m[144] = 'o';
m[143] = 'p';
m[191] = '@';
m[164] = '[';
m[245] = 0x0A;
m[128] = 0x7F;
// middle letter row
/*
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
m[] = '';
/**/
}
char translateKeyToChar(int key) {
return key; //m[key];
if (sizeof(m) <= key) {
return 0;
}
@ -156,10 +224,12 @@ void printChar(char keyChar) {
void processKbdByte(int data) {
int key = data;
char keyChar = translateKeyToChar(key);
if (modConsoleLog) {
Serial.print("Key: <"); Serial.print(int(key)); Serial.print("> ");
Serial.print("Char: "); printChar(keyChar);
}
char keyChar = translateKeyToChar(key);
#ifdef KEYBOARD
Keyboard.press(keyChar);
@ -168,11 +238,6 @@ void processKbdByte(int data) {
#endif
typeKey(keyChar);
if (modConsoleLog) {
Serial.print("Press: ");
printChar(keyChar);
}
}
// ----------------------