mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Update FR and ES keyboards (#4906)
Extend the FR and ES keyboards from the EN one, and just tweak what has to be changed. This will allow them to stay in sync with the EN keyboard's recent and futur developments of key popups. Also make the FR keyboard a bit more AZERTY.
This commit is contained in:
@@ -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,49 @@
|
||||
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
|
||||
|
||||
-- Insert an additional key at the end of 2nd row for M
|
||||
table.insert(keys[2],
|
||||
-- 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
{ "M", "m", "§", "+", "Д", "д", "Э", "э", "Œ", "œ", "Ő", "ő", }
|
||||
)
|
||||
-- And swap the english M on the 3rd row to ','
|
||||
keys[3][8][1] = ","
|
||||
keys[3][8][2] = ","
|
||||
-- And swap the english ',' on the 4th row (an extended key
|
||||
-- including a popup) to ';'
|
||||
local en_com = keys[4][5][1]
|
||||
en_com[1] = ";"
|
||||
en_com.north = "," -- and swap the ';' there to ','
|
||||
|
||||
-- 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
|
||||
popup.north, popup.east = popup.east, popup.north
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user