Commit 9724dfc1 authored by Jean-Baptiste Demonte's avatar Jean-Baptiste Demonte

Add AZERTY keyboard layout

parent 3af18c64
......@@ -279,7 +279,17 @@ void GuiMenu::menuSystem(){
s->addWithLabel(language_choice, _("LANGUAGE"), _(MenuMessages::LANGUAGE_HELP_MSG));
s->addSaveFunc([window, language_choice, language, optionsStorage, selectedStorage] {
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";
keyboard_choice->add("QWERTY", "qwerty", keyboard == "qwerty");
keyboard_choice->add("AZERTY", "azerty", keyboard == "azerty");
s->addWithLabel(keyboard_choice, _("KEYBOARD"), _(MenuMessages::KEYBOARD_HELP_MSG));
s->addSaveFunc([window, language_choice, language, keyboard_choice, keyboard, optionsStorage, selectedStorage] {
bool reboot = false;
if (optionsStorage->changed()) {
RecalboxSystem::getInstance()->setStorage(optionsStorage->getSelected());
......@@ -291,6 +301,12 @@ void GuiMenu::menuSystem(){
RecalboxConf::getInstance()->saveRecalboxConf();
reboot = true;
}
if (keyboard != keyboard_choice->getSelected()) {
RecalboxConf::getInstance()->set("system.keyboard", keyboard_choice->getSelected());
RecalboxConf::getInstance()->saveRecalboxConf();
}
if (reboot) {
window->pushGui(
new GuiMsgBox(window, _("THE SYSTEM WILL NOW REBOOT"), _("OK"), [window] {
......
......@@ -7,6 +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::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.";
......
......@@ -15,6 +15,7 @@ public:
static const char* DISK_USAGE_HELP_MSG;
static const char* STORAGE_DEVICE_HELP_MSG;
static const char* LANGUAGE_HELP_MSG;
static const char* KEYBOARD_HELP_MSG;
static const char* UPDATE_HELP_MSG;
static const char* START_UPDATE_HELP_MSG;
......
......@@ -2,6 +2,7 @@
#include "components/MenuComponent.h"
#include "Log.h"
#include "MenuThemeData.h"
#include <RecalboxConf.h>
using namespace Eigen;
......@@ -37,28 +38,51 @@ GuiTextEditPopupKeyboard::GuiTextEditPopupKeyboard(Window* window, const std::st
std::vector< std::vector< std::shared_ptr<ButtonComponent> > > buttonList;
std::vector<std::array<std::string, 12> > lines;
// Keyboard
// Case for if multiline is enabled, then don't create the keyboard.
if (!mMultiLine) {
std::vector<std::array<std::string, 12> > lines;
lines.push_back({ "1","2","3","4","5","6","7","8","9","0","_","+" });
lines.push_back({ "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "=" });
std::string keyboard = RecalboxConf::getInstance()->get("system.keyboard");
lines.push_back({ "à","ä","è","ë","ì","ï","ò","ö","ù","ü","¨","¿" });
lines.push_back({ "á", "â", "é", "ê", "í", "î", "ó", "ô", "ú", "û", "ñ", "¡" });
if (keyboard == "azerty")
{
lines.push_back({ "&", "é", "\"", "'", "(", "§", "è", "!", "ç", "à", ")", "-" });
lines.push_back({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "°", "_" });
lines.push_back({ "q","w","e","r","t","y","u","i","o","p","{","}" });
lines.push_back({ "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "[", "]" });
lines.push_back({ "à", "ä", "ë", "ì", "ï", "ò", "ö", "ü", "\\", "|", "#", "@" });
lines.push_back({ "á", "â", "ê", "í", "î", "ó", "ô", "ú", "û", "ñ", "¡", "¿" });
lines.push_back({ "a","s","d","f","g","h","j","k","l",";","\"","|" });
lines.push_back({ "A", "S", "D", "F", "G", "H", "J", "K", "L", ":", "'", "\\" });
lines.push_back({ "a", "z", "e", "r", "t", "y", "u", "i", "o", "p", "^", "$" });
lines.push_back({ "A", "Z", "E", "R", "T", "Y", "U", "I", "O", "P", "¨", "*" });
// Special case, SHIFT key at position 0
lines.push_back({ "", "~","z","x","c","v","b","n","m",",",".","?" });
lines.push_back({ "", "`", "Z", "X", "C", "V", "B", "N", "M", "<", ">", "/" });
lines.push_back({ "q", "s", "d", "f", "g", "h", "j", "k", "l", "m", "ù", "`" });
lines.push_back({ "Q", "S", "D", "F", "G", "H", "J", "K", "L", "M", "%", "£" });
// Special case, SHIFT key at position 0
lines.push_back({ "", "<", "w", "x", "c", "v", "b", "n", ",", ";", ":", "=" });
lines.push_back({ "", ">", "W", "X", "C", "V", "B", "N", "?", ".", "/", "+" });
}
else
{
lines.push_back({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "_", "+" });
lines.push_back({ "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "=" });
lines.push_back({ "à", "ä", "è", "ë", "ì", "ï", "ò", "ö", "ù", "ü", "¨", "¿" });
lines.push_back({ "á", "â", "é", "ê", "í", "î", "ó", "ô", "ú", "û", "ñ", "¡" });
lines.push_back({ "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "{", "}" });
lines.push_back({ "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "[", "]" });
lines.push_back({ "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "\"", "|" });
lines.push_back({ "A", "S", "D", "F", "G", "H", "J", "K", "L", ":", "'", "\\" });
// Special case, SHIFT key at position 0
lines.push_back({ "", "~", "z", "x", "c", "v", "b", "n", "m", ",", ".", "?" });
lines.push_back({ "", "`", "Z", "X", "C", "V", "B", "N", "M", "<", ">", "/" });
}
// Keyboard
// Case for if multiline is enabled, then don't create the keyboard.
if (!mMultiLine) {
for (unsigned int i = 0; i < 5; i++)
{
std::vector< std::shared_ptr<ButtonComponent> > buttons;
......
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