Select wanted language in Keyboard library

im using arduino pro micro (clone) and i uploaded my code and its working fine, but when as default keyboard language is not english, my program is useless, how can i make my arduino change keyboard language automaticly? (sorry for my bad english if there is something wrong :slight_smile: )

#include <Keyboard.h> 

// Init function
void setup()
{
  pinMode(3, INPUT_PULLUP);
  if (digitalRead(3) == LOW){
  while(1);
}

  Keyboard.begin();
  delay(500);

  delay(3000);

  Keyboard.press(KEY_LEFT_GUI);
  Keyboard.print("r");
  Keyboard.releaseAll();

  delay(500);

  Keyboard.print("cmd");

  delay(500);

  typeKey(KEY_RETURN);

  delay(1000);

  Keyboard.print("cd Desktop");

  typeKey(KEY_RETURN);
  Keyboard.releaseAll();

  delay(500);
  
  Keyboard.print("type nul > hahaha.bat");
  typeKey(KEY_RETURN);
  Keyboard.releaseAll();

  delay(500);

  Keyboard.print("notepad hahaha.bat");

  typeKey(KEY_RETURN);

  Keyboard.releaseAll();
  delay(1000);
  
  Keyboard.print("@echo off \necho Hello world!");
  Keyboard.press(KEY_LEFT_CTRL);
  Keyboard.print("s");
  
  Keyboard.releaseAll();
  delay(750);

  Keyboard.releaseAll();
  Keyboard.press(KEY_LEFT_ALT);
  Keyboard.press(KEY_F4);
  Keyboard.releaseAll();
  typeKey(KEY_RETURN);
  Keyboard.print("hahaha.bat");
  typeKey(KEY_RETURN);
  Keyboard.releaseAll();
  Keyboard.end();
}

void typeKey(int key)
{
  Keyboard.press(key);
  delay(50);
  Keyboard.release(key);
}

// Unused
void loop() {}

Hi @samurai1165
locate the file
"C:\Program Files (x86)\Arduino\libraries\Keyboard\src"
Edit and modify to get the keyboard you want.

RV mineirin

hi RV mineirin, if i edit the file you talked about, its not gonna work in other computers, right?

Hi @samurai1165
Right.
but I think you can create a library for yourself that calls each keyboard_US.h, Keyboard_FR.h, etc.. within your sketch.
RV mineirin

1 Like

so how can i make it? sorry im newbie :slight_smile:

Hi @samurai1165
so I suggested I checked and it won't work.
RV mineirin

1 Like

ok thx