I'm trying to make a macro keyboard, where I can press a single button and it will open programs for me.
I'm trying to type this, for example: "c:\windows"
but it gets typed out like this: cÑ}windows
I tried using double backslash (\), but it still isn't working
#include <HID-Project.h>
#include <HID-Settings.h>
#include <Keypad.h>
#define L_ALT KEY_LEFT_ALT
#define TAB KEY_TAB
#define WIN KEY_LEFT_GUI
#define ENTER KEY_RETURN
const byte FILAS = 4;
const byte COLUMNAS = 4;
//define the cymbols on the buttons of the keypads
char Keys[FILAS][COLUMNAS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte pinesFilas[FILAS] = {9, 8, 7, 6};
byte pinesColumnas[COLUMNAS] = {5, 4, 3, 2};
char TECLA;
Keypad teclado = Keypad( makeKeymap(Keys), pinesFilas, pinesColumnas, FILAS, COLUMNAS);
void setup() {
Serial.begin(9600);
Keyboard.begin();
}
void loop() {
TECLA = teclado.getKey();
if (TECLA) {
switch (TECLA) {
case '1':
Serial.print("Tecla 1 presionada");
break;
case '2':
Serial.print("Tecla 2 presionada");
break;
case '3':
Serial.print("Tecla 3 presionada");
break;
case 'A':
Serial.print("Tecla A presionada");
break;
case '4':
Serial.print("Tecla 4 presionada");
Keyboard.press(WIN);
Keyboard.write('r');
Keyboard.release(WIN);
delay(100);
Keyboard.print("C:\Program Files (x86)\AIMP\AIMP.exe"); //Here's the problem
//Keyboard.write(ENTER);
break;
case '5':
Serial.print("Tecla 5 presionada");
break;
case '6':
Serial.print("Tecla 6 presionada");
break;
case 'B':
Serial.print("Tecla B presionada");
break;
case '7':
Serial.print("Tecla 7 presionada");
break;
case '8':
Serial.print("Tecla 8 presionada");
break;
case '9':
Serial.print("Tecla 9 presionada");
break;
case 'C':
Serial.print("Tecla C presionada");
break;
case '*':
Serial.print("Tecla * presionada");
break;
case '0':
Serial.print("Tecla 0 presionada");
break;
case '#':
Serial.print("Tecla # presionada");
break;
case 'D':
Serial.print("Tecla D presionada");
break;
}
}
}