Commit 2b7737da authored by Jean-Baptiste Demonte's avatar Jean-Baptiste Demonte Committed by OyyoDams

feat(keyboard): handle keyboard layout (instead of qwerty / azerty)

parent 88f36427
......@@ -281,11 +281,16 @@ void GuiMenu::menuSystem(){
auto keyboard_choice = std::make_shared<OptionListComponent<std::string> >(window, _("KEYBOARD"), false);
std::string keyboard = RecalboxConf::getInstance()->get("system.keyboard");
if (keyboard.empty()) keyboard = "qwerty";
std::string keyboard = RecalboxConf::getInstance()->get("system.kblayout");
if (keyboard.empty()) keyboard = "us";
keyboard_choice->add("QWERTY", "qwerty", keyboard == "qwerty");
keyboard_choice->add("AZERTY", "azerty", keyboard == "azerty");
// linux loadkeys value
keyboard_choice->add("DE", "de", keyboard == "de");
keyboard_choice->add("DK", "dk", keyboard == "dk");
keyboard_choice->add("ES", "es", keyboard == "es");
keyboard_choice->add("FR", "fr", keyboard == "fr");
keyboard_choice->add("IT", "it", keyboard == "it");
keyboard_choice->add("US", "us", keyboard == "us");
s->addWithLabel(keyboard_choice, _("KEYBOARD"), _(MenuMessages::KEYBOARD_HELP_MSG));
......@@ -304,8 +309,9 @@ void GuiMenu::menuSystem(){
}
if (keyboard != keyboard_choice->getSelected()) {
RecalboxConf::getInstance()->set("system.keyboard", keyboard_choice->getSelected());
RecalboxConf::getInstance()->set("system.kblayout", keyboard_choice->getSelected());
RecalboxConf::getInstance()->saveRecalboxConf();
reboot = true;
}
if (reboot) {
......
......@@ -7,7 +7,7 @@ const char* MenuMessages::VERSION_HELP_MSG = "Shows your current recalboxOS vers
const char* MenuMessages::DISK_USAGE_HELP_MSG = "Show how much space is used on your SHARE partition, located either on the SDCARD or on an external drive. The information shows how much GB are used and how much GB your storage has overall (example 13GB/26GB).";
const char* MenuMessages::STORAGE_DEVICE_HELP_MSG = "Select an external drive to store your roms, saves, configurations etc.\nUse a FAT32 formatted drive. The system does not format the drive. On first boot, with this option enabled, recalbox will create a '/recalbox' folder with all system files inside.";
const char* MenuMessages::LANGUAGE_HELP_MSG = "Select your language. A reboot is needed to set this configuration active.";
const char* MenuMessages::KEYBOARD_HELP_MSG = "Select your keyboard type.";
const char* MenuMessages::KEYBOARD_HELP_MSG = "Select your keyboard layout.";
const char* MenuMessages::UPDATE_HELP_MSG = "Manage your recalbox updates. Select the update type. Activate update check.";
const char* MenuMessages::START_UPDATE_HELP_MSG = "Check if an update is available, and start the update process.";
......
......@@ -44,9 +44,9 @@ GuiTextEditPopupKeyboard::GuiTextEditPopupKeyboard(Window* window, const std::st
std::vector<std::array<std::string, 12> > lines;
std::string keyboard = RecalboxConf::getInstance()->get("system.keyboard");
std::string keyboard = RecalboxConf::getInstance()->get("system.kblayout");
if (keyboard == "azerty")
if (keyboard == "fr")
{
lines.push_back({ "&", "é", "\"", "'", "(", "§", "è", "!", "ç", "à", ")", "-" });
lines.push_back({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "°", "_" });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment