Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend FR and ES keyboards from the EN keyboard #4906

Merged
merged 3 commits into from Apr 12, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

Extend FR and ES keyboards from the EN keyboard

Avoid duplication with the EN keyboard, as most is the
same, and just tweak what has to be changed.
Will allow staying in sync with the EN keyboard recent
and futur developments of key popups.
  • Loading branch information...
poire-z committed Apr 12, 2019
commit 7c42378aab65ef5548ef41668abcdfb50a796644
@@ -1,71 +1,15 @@
return {
shiftmode_keys = {["Shift"] = true},
symbolmode_keys = {["Sym"] = true, ["ABC"] = true},
utf8mode_keys = {["IM"] = true},
umlautmode_keys = {["Äéß"] = true},
keys = {
-- first row
{ -- 1 2 3 4 5 6 7 8 9 10 11 12
{ "Q", "q", "", "0", "Й", "й", "?", "!", "Å", "å", "1", "ª", },
{ "W", "w", "!", "1", "Ц", "ц", "(", "1", "Ä", "ä", "2", "º", },
{ "E", "e", "@", "2", "У", "у", ")", "2", "Ö", "ö", "3", "¡", },
{ "R", "r", "#", "3", "К", "к", "~", "3", "ß", "ß", "4", "¿", },
{ "T", "t", "+", "=", "Е", "е", "Ә", "ә", "À", "à", "5", "¼", },
{ "Y", "y", "", "(", "Н", "н", "І", "і", "Â", "â", "6", "½", },
{ "U", "u", "", ")", "Г", "г", "Ң", "ң", "Æ", "æ", "7", "¾", },
{ "I", "i", "|", "\\", "Ш", "ш", "Ғ", "ғ", "Ü", "ü", "8", "©", },
{ "O", "o", "?", "/", "Щ", "щ", "Х", "х", "È", "è", "9", "®", },
{ "P", "p", "~", "`", "З", "з", "Ъ", "ъ", "É", "é", "0", "", },
},
-- second row
{ -- 1 2 3 4 5 6 7 8 9 10 11 12
{ "A", "a", "", "@", "Ф", "ф", "*", "0", "Ê", "ê", "Ş", "ş", },
{ "S", "s", "$", "4", "Ы", "ы", "+", "4", "Ë", "ë", "İ", "ı", },
{ "D", "d", "%", "5", "В", "в", "-", "5", "Î", "î", "Ğ", "ğ", },
{ "F", "f", "^", "6", "А", "а", "=", "6", "Ï", "ï", "Ć", "ć", },
{ "G", "g", ":", ";", "П", "п", "Ү", "ү", "Ô", "ô", "Č", "č", },
{ "H", "h", "\"", "'", "Р", "р", "Ұ", "ұ", "Œ", "œ", "Đ", "đ", },
{ "J", "j", "{", "[", "О", "о", "Қ", "қ", "Ù", "ù", "Š", "š", },
{ "K", "k", "}", "]", "Л", "л", "Ж", "ж", "Û", "û", "Ž", "ž", },
{ "L", "l", "_", "-", "Д", "д", "Э", "э", "Ÿ", "ÿ", "Ő", "ő", },
{ "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", },
},
-- third row
{ -- 1 2 3 4 5 6 7 8 9 10 11 12
{ label = "Shift",
icon = "resources/icons/appbar.arrow.shift.png",
width = 1.5
},
{ "Z", "z", "&", "7", "Я", "я", ":", "7", "Á", "á", "Ű", "ű", },
{ "X", "x", "*", "8", "Ч", "ч", ";", "8", "Ø", "ø", "Ã", "ã", },
{ "C", "c", "£", "9", "С", "с", "'", "9", "Í", "í", "Þ", "þ", },
{ "V", "v", "<", "", "М", "м", "Ө", "ө", "Ñ", "ñ", "Ý", "ý", },
{ "B", "b", ">", ".", "И", "и", "Һ", "һ", "Ó", "ó", "", "", },
{ "N", "n", "", "", "Т", "т", "Б", "б", "Ú", "ú", "", "", },
{ "M", "m", "", "", "Ь", "ь", "Ю", "ю", "Ç", "ç", "", "¨", },
{ label = "Backspace",
icon = "resources/icons/appbar.clear.reflect.horizontal.png",
width = 1.5
},
},
-- fourth row
{
{ "Sym", "Sym", "ABC", "ABC", "Sym", "Sym", "ABC", "ABC", "Sym", "Sym", "ABC", "ABC",
width = 1.5},
{ label = "IM",
icon = "resources/icons/appbar.globe.wire.png",
},
{ "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", },
{ label = "espacio",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
width = 3.0},
{ ",", ",", "", "", ",", ",", "Ё", "ё", "Ũ", "ũ", ",", ",", },
{ ".", ".", "", "", ".", ".", ".", ".", "Ĩ", "ĩ", ".", ".", },
{ label = "Enter",
"\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n",
icon = "resources/icons/appbar.arrow.enter.png",
width = 1.5,
},
},
},
}
-- Start with the english keyboard layout
local es_keyboard = dofile("frontend/ui/data/keyboardlayouts/en_keyboard.lua")

local keys = es_keyboard.keys

-- Insert an additional key at the end of 2nd row for easy Ñ and ñ
table.insert(keys[2],
-- 1 2 3 4 5 6 7 8 9 10 11 12
{ "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", }
)

-- Rename "space"
keys[4][4].label = "espacio"

return es_keyboard
@@ -1,70 +1,37 @@
return {
shiftmode_keys = {["Shift"] = true},
symbolmode_keys = {["Sym"] = true, ["ABC"] = true},
utf8mode_keys = {["IM"] = true},
umlautmode_keys = {["Äéß"] = true},
keys = {
-- first row
{ -- 1 2 3 4 5 6 7 8 9 10 11 12
{ "A", "a", "", "0", "Й", "й", "?", "!", "Å", "å", "1", "ª", },
{ "Z", "z", "!", "1", "Ц", "ц", "(", "1", "Ä", "ä", "2", "º", },
{ "E", "e", "@", "2", "У", "у", ")", "2", "Ö", "ö", "3", "¡", },
{ "R", "r", "#", "3", "К", "к", "~", "3", "ß", "ß", "4", "¿", },
{ "T", "t", "+", "=", "Е", "е", "Ә", "ә", "À", "à", "5", "¼", },
{ "Y", "y", "", "(", "Н", "н", "І", "і", "Â", "â", "6", "½", },
{ "U", "u", "", ")", "Г", "г", "Ң", "ң", "Æ", "æ", "7", "¾", },
{ "I", "i", "|", "\\", "Ш", "ш", "Ғ", "ғ", "Ü", "ü", "8", "©", },
{ "O", "o", "?", "/", "Щ", "щ", "Х", "х", "È", "è", "9", "®", },
{ "P", "p", "~", "`", "З", "з", "Ъ", "ъ", "É", "é", "0", "", },
},
-- second row
{ -- 1 2 3 4 5 6 7 8 9 10 11 12
{ "Q", "q", "", "@", "Ф", "ф", "*", "0", "Ê", "ê", "Ş", "ş", },
{ "S", "s", "$", "4", "Ы", "ы", "+", "4", "Ë", "ë", "İ", "ı", },
{ "D", "d", "%", "5", "В", "в", "-", "5", "Î", "î", "Ğ", "ğ", },
{ "F", "f", "^", "6", "А", "а", "=", "6", "Ï", "ï", "Ć", "ć", },
{ "G", "g", ":", ";", "П", "п", "Ү", "ү", "Ô", "ô", "Č", "č", },
{ "H", "h", "\"", "'", "Р", "р", "Ұ", "ұ", "Œ", "œ", "Đ", "đ", },
{ "J", "j", "{", "[", "О", "о", "Қ", "қ", "Ù", "ù", "Š", "š", },
{ "K", "k", "}", "]", "Л", "л", "Ж", "ж", "Û", "û", "Ž", "ž", },
{ "L", "l", "_", "-", "Д", "д", "Э", "э", "Ÿ", "ÿ", "Ő", "ő", },
},
-- third row
{ -- 1 2 3 4 5 6 7 8 9 10 11 12
{ label = "Shift",
icon = "resources/icons/appbar.arrow.shift.png",
width = 1.5
},
{ "W", "w", "&", "7", "Я", "я", ":", "7", "Á", "á", "Ű", "ű", },
{ "X", "x", "*", "8", "Ч", "ч", ";", "8", "Ø", "ø", "Ã", "ã", },
{ "C", "c", "£", "9", "С", "с", "'", "9", "Í", "í", "Þ", "þ", },
{ "V", "v", "<", "", "М", "м", "Ө", "ө", "Ñ", "ñ", "Ý", "ý", },
{ "B", "b", ">", ".", "И", "и", "Һ", "һ", "Ó", "ó", "", "", },
{ "N", "n", "", "", "Т", "т", "Б", "б", "Ú", "ú", "", "", },
{ "M", "m", "", "", "Ь", "ь", "Ю", "ю", "Ç", "ç", "", "¨", },
{ label = "Backspace",
icon = "resources/icons/appbar.clear.reflect.horizontal.png",
width = 1.5
},
},
-- fourth row
{
{ "Sym", "Sym", "ABC", "ABC", "Sym", "Sym", "ABC", "ABC", "Sym", "Sym", "ABC", "ABC",
width = 1.5},
{ label = "IM",
icon = "resources/icons/appbar.globe.wire.png",
},
{ "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", },
{ label = "space",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
width = 3.0},
{ ",", ",", "", "", ",", ",", "Ё", "ё", "Ũ", "ũ", ",", ",", },
{ ".", ".", "", "", ".", ".", ".", ".", "Ĩ", "ĩ", ".", ".", },
{ label = "Enter",
"\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n",
icon = "resources/icons/appbar.arrow.enter.png",
width = 1.5,
},
},
},
-- Start with the english keyboard layout
local fr_keyboard = dofile("frontend/ui/data/keyboardlayouts/en_keyboard.lua")

-- Swap the four AZWQ keys (only in the lowercase and
-- uppercase letters layouts) to change it from QWERTY to AZERTY
local keys = fr_keyboard.keys
keys[1][1][1], keys[2][1][1] = keys[2][1][1], keys[1][1][1] -- Q <> A
keys[1][1][2], keys[2][1][2] = keys[2][1][2], keys[1][1][2] -- q <> a
keys[1][2][1], keys[3][2][1] = keys[3][2][1], keys[1][2][1] -- W <> Z
keys[1][2][2], keys[3][2][2] = keys[3][2][2], keys[1][2][2] -- w <> z

-- Swap ê and ë (and the like) in the keyboard popups, so the
-- common french accentuated chars are all on the upper row.
local popups = {
keys[1][1][1], -- A
keys[1][1][2], -- a
keys[1][3][1], -- E
keys[1][3][2], -- e
keys[1][7][1], -- U
keys[1][7][2], -- u
keys[1][8][1], -- I
keys[1][8][2], -- i
keys[1][9][1], -- O
keys[1][9][2], -- o
}
for _, popup in ipairs(popups) do
if popup.east and popup.north then -- not all implemented yet

This comment has been minimized.

Copy link
@Frenzie

Frenzie Apr 12, 2019

Member

We can just add a couple of stubs instead? It's the other options that require thought but the basic òöóô-type ones should be fine.

This comment has been minimized.

Copy link
@Frenzie

Frenzie Apr 12, 2019

Member

PS I'll do that now. Shouldn't take more than a few mins.

This comment has been minimized.

Copy link
@poire-z

poire-z Apr 12, 2019

Author Contributor

Dunno (yet) what you mean by stub, but I'll see. But may be no need to add anything.

Anyway, I planned to remove that once you have implemented them for all.
So, no real need for anything more.

(And anyway, it's not even needed (and a bit wrong with my intent) : local toto = "zzz" ; toto.north returns nil, when I thought it would crash with "attempt to index a string" - but no - and if it's not a table it's a no-op)

This comment has been minimized.

Copy link
@Frenzie

Frenzie Apr 12, 2019

Member

Alright, so let's take out the if condition and merge it. ;-)

This comment has been minimized.

Copy link
@poire-z

poire-z Apr 12, 2019

Author Contributor

Alright. (so, UIO are done :)

This comment has been minimized.

Copy link
@Frenzie

Frenzie Apr 12, 2019

Member

Just a stub; it'd require some more research to call it done. :-)

popup.north, popup.east = popup.east, popup.north
end
end

-- Remove the "space" string
keys[4][4].label = ""
-- Or, if we'd rather have it in french:
-- keys[4][4].label = "espace"

return fr_keyboard
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.