Digistump Forums

The Digispark => Digispark Projects => Topic started by: sk3l on January 31, 2018, 04:08:22 pm

Title: Switch language
Post by: sk3l on January 31, 2018, 04:08:22 pm
Good day. How change language? i have 2 keyboards on windows, russian and english. When i try using it:
#include "DigiKeyboard.h"

void setup()
{
}

void loop()
{
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(3000);
DigiKeyboard.sendKeyStroke( MOD_ALT_LEFT , MOD_SHIFT_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print(F("notepad"));
DigiKeyboard.delay(600);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(750);
DigiKeyboard.print(F("Hello World!!!"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
for(;;){ /*empty*/ }
}

i have this:
Фтщеузфв
Руддщ Цщкдв!!!
thanks all for help
Title: Re: Switch language
Post by: MrCookie on April 30, 2018, 04:45:22 am
I dont think there is code designed for this. I did find this page that suggests you could possibly write code to change the keyboard layout through a keyboard command:
https://superuser.com/questions/1130835/windows-hotkey-to-change-keyboard-layout (https://superuser.com/questions/1130835/windows-hotkey-to-change-keyboard-layout)

I'm not entirely sure if your allowed to press two keys at the same time with the keyboard library.
Title: Re: Switch language
Post by: trelozakinthinos on May 07, 2019, 04:14:19 pm
sk3l,

In linux works as this

DigiKeyboard.sendKeyStroke(0 , MOD_SHIFT_LEFT | MOD_ALT_LEFT);

Probably in windows too but have not check it yet