Browse Source

Mapping of terminal key codes above 200

master
Dejvino 1 year ago
parent
commit
c64f2e44fa
1 changed files with 30 additions and 6 deletions
  1. +30
    -6
      terminal_keyboard_emulator.ino

+ 30
- 6
terminal_keyboard_emulator.ino View File

@@ -192,8 +192,8 @@ void setupKeyMapping() {
m[158+32] = 'A';
m[140] = 's';
m[140+32] = 'S';
m[153] = 'd'; // TODO
m[153+32] = 'D'; // TODO
m[155] = 'd';
m[155+32] = 'D';
m[153] = 'f';
m[153+32] = 'F';
m[152] = 'g';
@@ -237,8 +237,8 @@ void setupKeyMapping() {
m[208+32] = '?';
m[163] = '\\';
m[163+32] = '|';
m[78] = 'd'; // Blank cap
m[77] = 'D'; // Blank cap + shift
m[78] = 'x'; // Blank cap
m[77] = 'X'; // Blank cap + shift
// spacebar
m[223] = ' '; // Spacebar
/*/ numpad
@@ -302,6 +302,25 @@ void setupKeyMapping() {
m[] = '';
m[] = '';
/**/
//
// 208 local ON
// 209 leave local
// 210 half/full duplex
// 211 go home?
// 212 print Ps junk
// 213 mem protect
// 214 disable NAT
// 217 clear line?
// 218 shows cursor
// 219 hides cursor
// 221 mem prot
// 223 reset prompt
// 241 random junk symbols
// 243 random junk symbols
// 244 stop junk
// 248 hides cursor
// 251 Hard copy
// 250 Keyb. Inh.
}

char translateKeyToChar(int key) {
@@ -372,6 +391,7 @@ void setup(void)
Serial.println("Keyboard ready");
}

int qwe = 0;
void loop(void)
{
// type key from serial
@@ -392,8 +412,12 @@ void loop(void)
/**/

/*/ auto-type test
delay(500);
typeKey('B');
delay(2000);
int k = 128 + qwe;
typeKey(k);
qwe = (qwe + 1) % 128;
Serial.print("QWE "); Serial.println((int)k);
if (qwe % 5 == 0) delay(2000);
/**/
}


Loading…
Cancel
Save