VirtualKeyboard: redesign and enhancements (#8089)

See #8089 for all the details.
reviewable/pr8131/r1
mergen3107 3 years ago committed by GitHub
parent 684fd6c12d
commit fdae07e2cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,7 +3,7 @@ local de_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayou
local keys = de_keyboard.keys local keys = de_keyboard.keys
keys[1][6][1], keys[3][2][1] = keys[3][2][1], keys[1][6][1] -- Z <-> Y keys[2][6][1], keys[4][2][1] = keys[4][2][1], keys[2][6][1] -- Z <-> Y
keys[1][6][2], keys[3][2][2] = keys[3][2][2], keys[1][6][2] -- z <-> y keys[2][6][2], keys[4][2][2] = keys[4][2][2], keys[2][6][2] -- z <-> y
return de_keyboard return de_keyboard

@ -1,8 +1,10 @@
local en_popup = require("ui/data/keyboardlayouts/keypopup/en_popup") local en_popup = require("ui/data/keyboardlayouts/keypopup/en_popup")
local com = en_popup.com -- comma (,) local pco = en_popup.pco
local prd = en_popup.prd -- period (.) local cop = en_popup.cop
local _at = en_popup._at local cse = en_popup.cse
local _eq = en_popup._eq -- equals sign (=) local sec = en_popup.sec
local quo = en_popup.quo
-- English letters
local _A_ = en_popup._A_ local _A_ = en_popup._A_
local _a_ = en_popup._a_ local _a_ = en_popup._a_
local _B_ = en_popup._B_ local _B_ = en_popup._B_
@ -55,73 +57,142 @@ local _Y_ = en_popup._Y_
local _y_ = en_popup._y_ local _y_ = en_popup._y_
local _Z_ = en_popup._Z_ local _Z_ = en_popup._Z_
local _z_ = en_popup._z_ local _z_ = en_popup._z_
-- other
local _1_ = en_popup._1_ -- numeric key 1
local _1p = en_popup._1p -- numeric key 1, popup sibling (they have north swipe ups of each other, the rest is the same)
local _1n = en_popup._1n -- numpad key 1
local _1s = en_popup._1s -- superscript key 1
local _2_ = en_popup._2_
local _2p = en_popup._2p
local _2n = en_popup._2n
local _2s = en_popup._2s
local _3_ = en_popup._3_
local _3p = en_popup._3p
local _3n = en_popup._3n
local _3s = en_popup._3s
local _4_ = en_popup._4_
local _4p = en_popup._4p
local _4n = en_popup._4n
local _4s = en_popup._4s
local _5_ = en_popup._5_
local _5p = en_popup._5p
local _5n = en_popup._5n
local _5s = en_popup._5s
local _6_ = en_popup._6_
local _6p = en_popup._6p
local _6n = en_popup._6n
local _6s = en_popup._6s
local _7_ = en_popup._7_
local _7p = en_popup._7p
local _7n = en_popup._7n
local _7s = en_popup._7s
local _8_ = en_popup._8_
local _8p = en_popup._8p
local _8n = en_popup._8n
local _8s = en_popup._8s
local _9_ = en_popup._9_
local _9p = en_popup._9p
local _9n = en_popup._9n
local _9s = en_popup._9s
local _0_ = en_popup._0_
local _0p = en_popup._0p
local _0n = en_popup._0n
local _0s = en_popup._0s
local sla = en_popup.sla
local sl2 = en_popup.sl2
local eql = en_popup.eql
local eq2 = en_popup.eq2
local pls = en_popup.pls
local pl2 = en_popup.pl2
local mns = en_popup.mns
local mn2 = en_popup.mn2
local dsh = en_popup.dsh
local dgr = en_popup.dgr
local tpg = en_popup.tpg
local mth = en_popup.mth
local mt2 = en_popup.mt2
local int = en_popup.int
local dif = en_popup.dif
local df2 = en_popup.df2
local ls1 = en_popup.ls1
local ls2 = en_popup.ls2
local mr1 = en_popup.mr1
local mr2 = en_popup.mr2
local pdc = en_popup.pdc
local pd2 = en_popup.pd2
local bar = en_popup.bar
local prm = en_popup.prm
local hsh = en_popup.hsh
local hs2 = en_popup.hs2
return { return {
min_layer = 1, min_layer = 1,
max_layer = 8, max_layer = 4,
shiftmode_keys = {[""] = true, ["1/2"] = true, ["2/2"] = true,}, shiftmode_keys = { [""] = true },
symbolmode_keys = {["Sym"] = true, ["ABC"] = true}, symbolmode_keys = { [""] = true },
utf8mode_keys = {["🌐"] = true}, utf8mode_keys = { ["🌐"] = true },
umlautmode_keys = {["Äéß"] = true}, -- Width of any key can be modified by adding "width = 1.0, " in the list.
keys = { keys = {
-- first row -- First row
{ -- 1 2 3 4 5 6 7 8 { -- R r S s
{ _Q_, _q_, "", "0", "Å", "å", "1", "ª", }, { _1p, _1_, "`", "!", },
{ _W_, _w_, "!", "1", "Ä", "ä", "2", "º", }, { _2p, _2_, "", "¡", },
{ _E_, _e_, _at, "2", "Ö", "ö", "3", "¡", }, { _3p, _3_, "", dsh, },
{ _R_, _r_, "#", "3", "", "ß", "4", "¿", }, { _4p, _4_, "", "_", },
{ _T_, _t_, "+", _eq, "À", "à", "5", "¼", }, { _5p, _5_, "", quo, },
{ _Y_, _y_, "", "(", "Â", "â", "6", "½", }, { _6p, _6_, eq2, eql, },
{ _U_, _u_, "", ")", "Æ", "æ", "7", "¾", }, { _7p, _7_, _7s, _7n, },
{ _I_, _i_, "|", "\\", "Ü", "ü", "8", "©", }, { _8p, _8_, _8s, _8n, },
{ _O_, _o_, "?", "/", "È", "è", "9", "®", }, { _9p, _9_, _9s, _9n, },
{ _P_, _p_, "~", "`", "É", "é", "0", "", }, { _0p, _0_, mn2, mns, },
}, },
-- second row -- Second row
{ -- 1 2 3 4 5 6 7 8 { -- R r S s
{ _A_, _a_, "", _at, "Ê", "ê", "Ş", "ş", }, { _Q_, _q_, dif, "?", },
{ _S_, _s_, "$", "4", "Ë", "ë", "İ", "ı", }, { _W_, _w_, int, "¿", },
{ _D_, _d_, "%", "5", "Î", "î", "Ğ", "ğ", }, { _E_, _e_, mth, "~", },
{ _F_, _f_, "^", "6", "Ï", "ï", "Ć", "ć", }, { _R_, _r_, mt2, "\\", },
{ _G_, _g_, ":", ";", "Ô", "ô", "Č", "č", }, { _T_, _t_, df2, bar, },
{ _H_, _h_, '"', "'", "Œ", "œ", "Đ", "đ", }, { _Y_, _y_, sl2, sla, },
{ _J_, _j_, "{", "[", "Ù", "ù", "Š", "š", }, { _U_, _u_, _4s, _4n, },
{ _K_, _k_, "}", "]", "Û", "û", "Ž", "ž", }, { _I_, _i_, _5s, _5n, },
{ _L_, _l_, "_", "-", "Ÿ", "ÿ", "Ő", "ő", }, { _O_, _o_, _6s, _6n, },
{ _P_, _p_, pl2, pls, },
}, },
-- third row -- Third row
{ -- 1 2 3 4 5 6 7 8 { -- R r S s
{ "", "", "2/2", "1/2", "", "", "", "", { _A_, _a_, ls2, ls1, },
width = 1.5 { _S_, _s_, mr2, mr1, },
}, { _D_, _d_, dgr, "(", },
{ _Z_, _z_, "&", "7", "Á", "á", "Ű", "ű", }, { _F_, _f_, tpg, ")", },
{ _X_, _x_, "*", "8", "Ø", "ø", "Ã", "ã", }, { _G_, _g_, hs2, hsh, },
{ _C_, _c_, "£", "9", "Í", "í", "Þ", "þ", }, { _H_, _h_, pd2, pdc, },
{ _V_, _v_, "<", com, "Ñ", "ñ", "Ý", "ý", }, { _J_, _j_, _1s, _1n, },
{ _B_, _b_, ">", prd, "Ó", "ó", "", "", }, { _K_, _k_, _2s, _2n, },
{ _N_, _n_, "", "", "Ú", "ú", "", "", }, { _L_, _l_, _3s, _3n, },
{ _M_, _m_, "", "", "Ç", "ç", "", "¨", }, { sec, cse, sec, cse, }, -- comma/semicolon with CSS popup block
{ label = "",
width = 1.5,
bold = false
},
}, },
-- fourth row -- Fourth row
{ { -- R r S s
{ "Sym", "Sym", "ABC", "ABC", "Sym", "Sym", "ABC", "ABC", { label = "", width = 1.5, }, -- Shift
width = 1.5}, { _Z_, _z_, prm, "{", },
{ label = "🌐", }, { _X_, _x_, "°", "}", },
{ "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", "Äéß", }, { _C_, _c_, "«", "[", },
{ label = "space", { _V_, _v_, "»", "]", },
" ", " ", " ", " ", " ", " ", " ", " ", { _B_, _b_, _0s, _0n, },
width = 3.0}, { _N_, _n_, "", "", },
{ com, com, "", "", "Ũ", "ũ", com, com, }, { _M_, _m_, "", "", },
{ prd, prd, "", "", "Ĩ", "ĩ", prd, prd, }, { label = "", width = 1.5, }, -- Backspace
{ label = "", },
"\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", -- Fifth row
width = 1.5, { -- R r S s
bold = true { label = "", width = 1.5, bold = true, alt_label = "SYM"}, -- SYM key
}, { label = "🌐", }, -- Globe key
{ cop, pco, cop, pco, }, -- period/colon with RegEx popup block
{ label = "_", " ", " ", " ", " ", width = 3.0, }, -- Spacebar
{ label = "", }, -- Arrow left
{ label = "", }, -- Arrow right
{ label = "", "\n","\n","\n","\n", width = 1.5, }, -- Enter
}, },
}, },
} }

@ -4,12 +4,25 @@ local es_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayou
local keys = es_keyboard.keys local keys = es_keyboard.keys
-- Insert an additional key at the end of 2nd row for easy Ñ and ñ -- Insert an additional key at the end of 2nd row for easy Ñ and ñ
table.insert(keys[2], table.insert(keys[4], 7,
-- 1 2 3 4 5 6 7 8 { { "Ñ", north = "ñ", }, { "ñ", north = "Ñ", }, { "¿", alt_label = "¡", }, { "¡", alt_label = "¿", }, }
{ "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", "Ñ", "ñ", }
) )
-- put zero in its usual space under numpad (layers 3 and 4)
keys[4][6][3], keys[4][7][3] = keys[4][7][3], keys[4][6][3]
keys[4][6][4], keys[4][7][4] = keys[4][7][4], keys[4][6][4]
-- swap "ñ" and ","
keys[4][7][1], keys[3][10][1] = keys[3][10][1], keys[4][7][1]
keys[4][7][2], keys[3][10][2] = keys[3][10][2], keys[4][7][2]
-- change order ", n m" to "n m ,"
keys[4][7][1], keys[4][8][1], keys[4][9][1] = keys[4][8][1], keys[4][9][1], keys[4][7][1]
keys[4][7][2], keys[4][8][2], keys[4][9][2] = keys[4][8][2], keys[4][9][2], keys[4][7][2]
-- Rename "space" -- Rename "space"
keys[4][4].label = "espacio" keys[5][4].label = "espacio"
keys[4][1].width = 1.0 -- resize Shift
keys[4][10].width = 1.0 -- resize Enter
return es_keyboard return es_keyboard

@ -4,62 +4,27 @@ local fr_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayou
-- Swap the four AZWQ keys (only in the lowercase and -- Swap the four AZWQ keys (only in the lowercase and
-- uppercase letters layouts) to change it from QWERTY to AZERTY -- uppercase letters layouts) to change it from QWERTY to AZERTY
local keys = fr_keyboard.keys local keys = fr_keyboard.keys
keys[1][1][1], keys[2][1][1] = keys[2][1][1], keys[1][1][1] -- Q <> A keys[2][1][1], keys[3][1][1] = keys[3][1][1], keys[2][1][1] -- Q <> A
keys[1][1][2], keys[2][1][2] = keys[2][1][2], keys[1][1][2] -- q <> a keys[2][1][2], keys[3][1][2] = keys[3][1][2], keys[2][1][2] -- q <> a
keys[1][2][1], keys[3][2][1] = keys[3][2][1], keys[1][2][1] -- W <> Z keys[2][2][1], keys[4][2][1] = keys[4][2][1], keys[2][2][1] -- W <> Z
keys[1][2][2], keys[3][2][2] = keys[3][2][2], keys[1][2][2] -- w <> z keys[2][2][2], keys[4][2][2] = keys[4][2][2], keys[2][2][2] -- w <> z
-- And as A/a is now near the left border, re-order the popup keys so that we can get
-- the à (very common in french) with a swipe south-east instead of hard north-west
keys[2][1][1].southeast, keys[2][1][1].northwest = keys[2][1][1].northwest, keys[2][1][1].southeast
keys[2][1][2].southeast, keys[2][1][2].northwest = keys[2][1][2].northwest, keys[2][1][2].southeast
-- Insert an additional key at the end of 2nd row for M -- Swap the M and ',' keys
table.insert(keys[2], keys[3][10][1], keys[4][8][1] = keys[4][8][1], keys[3][10][1] -- M <> ;
-- 1 2 3 4 5 6 7 8 keys[3][10][2], keys[4][8][2] = keys[4][8][2], keys[3][10][2] -- m <> ,
{ "M", "m", "§", "+", "Œ", "œ", "Ő", "ő", } -- And as M/m is now near the right border, swap its popup east swipes to be west swipes
) keys[3][10][1].northwest, keys[3][10][1].northeast = keys[3][10][1].northeast, nil
-- But replace the alpha "M" and "m" with the original key+popup from english M/m keys[3][10][2].northwest, keys[3][10][2].northeast = keys[3][10][2].northeast, nil
keys[2][10][1] = keys[3][8][1] keys[3][10][1].west, keys[3][10][1].east = keys[3][10][1].east, nil
keys[2][10][2] = keys[3][8][2] keys[3][10][2].west, keys[3][10][2].east = keys[3][10][2].east, nil
-- We have one more key than en_keyboard: replace that original M key
-- to show another char on alpha layouts: let's use ";", and a popup
-- helpful for CSS style tweaks editing.
local _semicolon = {
";",
-- north = "!",
north = { label = "!…", key = "!important;" },
northeast = "}",
northwest = "{",
west = "-",
east = ":",
south = "*",
southwest = "0",
southeast = ">",
"[",
'+',
"]",
}
keys[3][8][1] = _semicolon
keys[3][8][2] = _semicolon
-- 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 -- Remove the "space" string
keys[4][4].label = "" keys[5][4].label = ""
-- Or, if we'd rather have it in french: -- Or, if we'd rather have it in french:
-- keys[4][4].label = "espace" -- keys[5][4].label = "espace"
return fr_keyboard return fr_keyboard

@ -1,5 +1,9 @@
local en_popup = require("ui/data/keyboardlayouts/keypopup/en_popup") local en_popup = require("ui/data/keyboardlayouts/keypopup/en_popup")
local he_popup = require("ui/data/keyboardlayouts/keypopup/he_popup") local he_popup = require("ui/data/keyboardlayouts/keypopup/he_popup")
local pco = en_popup.pco
local cop = en_popup.cop
local cse = en_popup.cse
local sec = en_popup.sec
local com = en_popup.com -- comma (,) local com = en_popup.com -- comma (,)
local prd = en_popup.prd -- period (.) local prd = en_popup.prd -- period (.)
local _at = en_popup._at local _at = en_popup._at
@ -32,7 +36,7 @@ return {
min_layer = 1, min_layer = 1,
max_layer = 4, max_layer = 4,
shiftmode_keys = {[""] = true}, shiftmode_keys = {[""] = true},
symbolmode_keys = {["Sym"] = true, ["אבג"] = true}, symbolmode_keys = { [""] = true },
utf8mode_keys = {["🌐"] = true}, utf8mode_keys = {["🌐"] = true},
keys = { keys = {
-- first row -- first row
@ -59,6 +63,7 @@ return {
{ "ֶ ", "ח", "{", "[", }, { "ֶ ", "ח", "{", "[", },
{ "ַ ", lamed, "}", "]", }, { "ַ ", lamed, "}", "]", },
{ "ָ ", "ך", "_", "-", }, { "ָ ", "ך", "_", "-", },
{ sec, cse, sec, cse, }, -- comma/semicolon with CSS popup block
}, },
-- third row -- third row
{ -- 1 2 3 4 { -- 1 2 3 4
@ -79,11 +84,11 @@ return {
}, },
-- fourth row -- fourth row
{ {
{ "Sym", "Sym", "אבג", "אבג", { label = "", width = 1.5, bold = true, alt_label = "SYM"}, -- SYM key
width = 1.5},
{ label = "🌐", }, { label = "🌐", },
{ cop, pco, cop, pco, }, -- period/colon with RegEx popup block
{ " ", " ", " ", " ", { " ", " ", " ", " ",
width = 3.0}, width = 3.0, label = "_"},
{ com, taf, "", "", }, { com, taf, "", "", },
{ prd, "ץ", "", "", }, { prd, "ץ", "", "", },
{ label = "", { label = "",

@ -2,501 +2,619 @@ return {
com = { com = {
",", ",",
north = ";", north = ";",
alt_label = ";",
northeast = "(", northeast = "(",
northwest = "\\", northwest = "¿",
east = "?", east = "",
west = "¿", west = "?",
"{",
"}",
"[",
}, },
prd = { prd = {
".", ".",
north = ":", north = ":",
alt_label = ":",
northeast = ")", northeast = ")",
northwest = "/", northwest = "¡",
east = "", east = "",
west = "!", west = "!",
"]",
"-",
"_",
}, },
_at = { _at = {
"@", "@",
north = "", north = "",
alt_label = "",
northeast = "", northeast = "",
northwest = "", northwest = "",
}, },
_eq = { _eq = {
"=", "=",
north = "", north = "_",
alt_label = "_",
northwest = "-",
west = "",
south = "",
southwest = "",
},
pco = { -- period + colon
".",
north = ":",
alt_label = ":",
northeast = "'",
northwest = "=",
east = "!",
west = "?",
south = "|",
southeast = "\\",
southwest = "/",
'^',
"&",
"$",
},
cop = { -- colon + period
":",
north = ".",
alt_label = ".",
northeast = "'",
northwest = "=",
east = "!",
west = "?",
south = "|",
southeast = "\\",
southwest = "/",
'^',
"&",
"$",
},
quo = {
'"',
north = "'",
alt_label = "'",
northeast = "»", northeast = "»",
northwest = "«", northwest = "«",
east = ">", east = "",
west = "<", west = "",
south = "", south = "`",
southeast = "", southeast = "",
southwest = "", southwest = "",
"",
"",
},
cse = { -- comma + semicolon
",",
north = ";",
alt_label = ";",
northeast = "}",
northwest = "{",
east = { label = "!…", key = "!important;" },
west = "-",
south = "*",
southwest = "0",
southeast = ">",
"[",
"+",
"]",
},
sec = { -- semicolon + comma
";",
north = ",",
alt_label = ",",
northeast = "}",
northwest = "{",
east = { label = "!…", key = "!important;" },
west = "-",
south = "*",
southwest = "0",
southeast = ">",
"[",
"*",
"]",
}, },
_A_ = { _A_ = {
"A", "A",
north = "Ä", north = "a",
northeast = "Á", northeast = "Á",
northwest = "À", northwest = "À",
east = "Â", east = "Â",
west = "Ã", west = "Ã",
south = "Ą", south = "Ą",
southeast = "Æ", southeast = "Ä",
southwest = "Å", southwest = "Å",
"Ā", "Ā",
"Ǎ", "Ǎ",
"Æ",
}, },
_a_ = { _a_ = {
"a", "a",
north = "ä", north = "A",
northeast = "á", northeast = "á",
northwest = "à", northwest = "à",
east = "â", east = "â",
west = "ã", west = "ã",
south = "ą", south = "ą",
southeast = "æ", southeast = "ä",
southwest = "å", southwest = "å",
"ā", "ā",
"ǎ", "ǎ",
"æ",
}, },
_B_ = { _B_ = {
"B", "B",
north = "Β", north = "b",
northeast = "β", east = "Β", -- Greek beta
northwest = "", west = "",
}, },
_b_ = { _b_ = {
"b", "b",
north = "Β", north = "B",
northeast = "β", east = "β", -- Greek beta
northwest = "", west = "",
}, },
_C_ = { _C_ = {
"C", "C",
north = "Ċ", north = "c",
northeast = "Ć", northeast = "Ć",
northwest = "🄯", -- copyleft symbol northwest = "🄯", -- copyleft symbol
east = "Ĉ", east = "Ĉ",
west = "Č", west = "Č",
south = "Ç", south = "Ç",
southeast = "©", -- copyright symbol southeast = "©", -- copyright symbol
southwest = "¢", -- cent sign southwest = "Ċ", -- cent sign
"¢",
}, },
_c_ = { _c_ = {
"c", "c",
north = "ċ", north = "C",
northeast = "ć", northeast = "ć",
northwest = "🄯", -- copyleft symbol northwest = "🄯", -- copyleft symbol
east = "ĉ", east = "ĉ",
west = "č", west = "č",
south = "ç", south = "ç",
southeast = "©", -- copyright symbol southeast = "©", -- copyright symbol
southwest = "¢", -- cent sign southwest = "ċ", -- cent sign
"¢",
}, },
_D_ = { _D_ = {
"D", "D",
north = "Đ", north = "d",
northeast = "Ð", northeast = "Ð",
northwest = "Ď", northwest = "Ď",
east = "Δ", east = "$", -- Dollar currency
west = "Đ",
south = "", -- partial derivative
southeast = "Δ", -- Greek delta
}, },
_d_ = { _d_ = {
"d", "d",
north = "đ", north = "D",
northeast = "ð", northeast = "ð",
northwest = "ď", northwest = "ď",
east = "δ", east = "$", -- Dollar currency
west = "đ",
south = "", -- partial derivative
southeast = "δ", -- Greek delta
}, },
_E_ = { _E_ = {
"E", "E",
north = "Ë", north = "e",
northeast = "É", northeast = "É",
northwest = "È", northwest = "È",
east = "Ê", east = "Ê",
west = "", west = "",
south = "Ę", south = "Ę",
southeast = "", southeast = "Ë",
southwest = "Ė", southwest = "Ė",
"Ē", "Ē",
"Ě", "Ě",
"ɛ", "", -- Euro currency
}, },
_e_ = { _e_ = {
"e", "e",
north = "ë", north = "E",
northeast = "é", northeast = "é",
northwest = "è", northwest = "è",
east = "ê", east = "ê",
west = "", west = "",
south = "ę", south = "ę",
southeast = "", southeast = "ë",
southwest = "ė", southwest = "ė",
"ē", "ē",
"ě", "ě",
"ɛ", "", -- Euro currency
}, },
_F_ = { _F_ = {
"F", "F",
north = "f",
east = "ƒ", -- Guilder/Florin east = "ƒ", -- Guilder/Florin
west = "Φ", -- uppercase phi
}, },
_f_ = { _f_ = {
"f", "f",
north = "F",
east = "ƒ", -- Guilder/Florin east = "ƒ", -- Guilder/Florin
west = "φ", -- lowercase phi
}, },
_G_ = { _G_ = {
"G", "G",
north = "g",
northeast = "Γ", -- Greek gamma
east = "ɣ", -- voiced velar fricative IPA east = "ɣ", -- voiced velar fricative IPA
west = "Γ", -- uppercase gamma
}, },
_g_ = { _g_ = {
"g", "g",
north = "G",
northeast = "γ", -- Greek gamma
east = "ɣ", -- voiced velar fricative IPA east = "ɣ", -- voiced velar fricative IPA
west = "γ", -- lowercase gamma
}, },
_H_ = { _H_ = {
"H", "H",
north = "h",
east = "ɥ", -- labialized palatal approximant (like a combination between /w/ and /y/) east = "ɥ", -- labialized palatal approximant (like a combination between /w/ and /y/)
west = "Η", -- uppercase eta
}, },
_h_ = { _h_ = {
"h", "h",
north = "H",
east = "ɥ", -- labialized palatal approximant (like a combination between /w/ and /y/) east = "ɥ", -- labialized palatal approximant (like a combination between /w/ and /y/)
west = "η", -- lowercase eta
}, },
_I_ = { _I_ = {
"I", "I",
north = "Ï", north = "i",
northeast = "Í", northeast = "Í",
northwest = "Ì", northwest = "Ì",
east = "Î", east = "Î",
west = "Ĩ", west = "Ĩ",
south = "Į", south = "Į",
southeast = "Ï",
southwest = "ɪ",
"Ī", "Ī",
"ɪ", -- small capital letter i, near-close front unrounded vowel IPA "Ι", -- Greek iota
"I", -- dotless I (Turkish)
}, },
_i_ = { _i_ = {
"i", "i",
north = "ï", north = "I",
northeast = "í", northeast = "í",
northwest = "ì", northwest = "ì",
east = "î", east = "î",
west = "ĩ", west = "ĩ",
south = "į", south = "į",
southeast = "ï",
southwest = "ɪ",
"ī", "ī",
"ɪ", -- small capital letter i, near-close front unrounded vowel IPA "ι", -- Greek iota
"ı", -- dotless i (Turkish)
}, },
_J_ = { _J_ = {
"J", "J",
north = "j",
east = "ʝ", -- voiced palatal fricative east = "ʝ", -- voiced palatal fricative
}, },
_j_ = { _j_ = {
"j", "j",
north = "J",
east = "ʝ", -- voiced palatal fricative east = "ʝ", -- voiced palatal fricative
}, },
_K_ = { _K_ = {
"K", "K",
north = '"', north = "k",
south = "Ķ", northwest = "Κ", -- Greek kappa
east = "", -- hyphen minus west = "Ķ",
southeast = "", -- em dash
southwest = "", -- en dash
"Κ", -- kappa uppercase
"κ", -- kappa lowercase
}, },
_k_ = { _k_ = {
"k", "k",
north = '"', north = "K",
south = "ķ", northwest = "κ", -- Greek kappa
east = "", -- hyphen minus west = "ķ",
southeast = "", -- em dash
southwest = "", -- en dash
"Κ", -- kappa uppercase
"κ", -- kappa lowercase
}, },
_L_ = { _L_ = {
"L", "L",
north = "'", north = "l",
northeast = "Ĺ", northeast = "Ĺ",
northwest = "Ľ", northwest = "Ľ",
east = "+",
west = "Ł", west = "Ł",
south = "Ļ", south = "Ļ",
southeast = "£", southeast = "Λ", -- Greek lambda
southwest = "", -- abbreviation for vel (Latin or) southwest = "", -- abbreviation for vel (Latin or)
"Λ", east = "ɫ", -- dark l, velarized alveolar lateral approximant IPA
"λ",
"ɫ", -- dark l, velarized alveolar lateral approximant IPA
}, },
_l_ = { _l_ = {
"l", "l",
north = "'", north = "L",
northeast = "ĺ", northeast = "ĺ",
northwest = "ľ", northwest = "ľ",
east = "+",
west = "ł", west = "ł",
south = "ļ", south = "ļ",
southeast = "£", southeast = "λ", -- Greek lambda
southwest = "", -- abbreviation for vel (Latin or) southwest = "", -- abbreviation for vel (Latin or)
"Λ", east = "ɫ", -- dark l, velarized alveolar lateral approximant IPA
"λ",
"ɫ", -- dark l, velarized alveolar lateral approximant IPA
}, },
_M_ = { _M_ = {
"M", "M",
north = "m",
northeast = "Μ", -- Greek mu
east = "ɱ", -- labiodental nasal IPA east = "ɱ", -- labiodental nasal IPA
west = "Μ", -- upptercase mu
}, },
_m_ = { _m_ = {
"m", "m",
north = "M",
northeast = "μ", -- Greek mu
east = "ɱ", -- labiodental nasal IPA east = "ɱ", -- labiodental nasal IPA
west = "μ", -- lowercase mu
}, },
_N_ = { _N_ = {
"N", "N",
north = "Ñ", north = "n",
northeast = "Ń", northeast = "Ń",
northwest = "Ǹ", northwest = "Ǹ",
east = "ɲ", -- palatal nasal IPA east = "ɲ", -- palatal nasal IPA
west = "Ν", -- uppercase nu west = "Ñ",
southeast = "Ŋ", -- uppercase letter eng (ligature of N and G)
south = "Ņ", south = "Ņ",
southwest = "Ň", -- Czech southeast = "Ŋ", -- uppercase letter eng (ligature of N and G)
southwest = "Ν", -- Greek nu
"Ň", -- Czech
}, },
_n_ = { _n_ = {
"n", "n",
north = "ñ", north = "N",
northeast = "ń", northeast = "ń",
northwest = "ǹ", northwest = "ǹ",
east = "ɲ", -- palatal nasal IPA east = "ɲ", -- palatal nasal IPA
west = "ν", -- lowercase nu west = "ñ",
southeast = "ŋ", -- letter eng (ligature of N and G), velar nasal IPA
south = "ņ", south = "ņ",
southwest = "ň", -- Czech southeast = "ŋ", -- letter eng (ligature of N and G), velar nasal IPA
southwest = "ν", -- Greek nu
"ň", -- Czech
}, },
_O_ = { _O_ = {
"O", "O",
north = "Ö", north = "o",
northeast = "Ó", northeast = "Ó",
northwest = "Ò", northwest = "Ò",
east = "Ô", east = "Ô",
west = "Õ", west = "Õ",
south = "Ǫ", south = "Ǫ",
southeast = "Œ", southeast = "Ö",
southwest = "Ø", southwest = "Ø",
"Ō", "Ō",
"ɔ", -- open o, open-mid back rounded vowel IPA "ɔ", -- open o, open-mid back rounded vowel IPA
"ɒ", -- turned alpha, open back rounded vowel IPA "Œ",
}, },
_o_ = { _o_ = {
"o", "o",
north = "ö", north = "O",
northeast = "ó", northeast = "ó",
northwest = "ò", northwest = "ò",
east = "ô", east = "ô",
west = "õ", west = "õ",
south = "ǫ", south = "ǫ",
southeast = "œ", southeast = "ö",
southwest = "ø", southwest = "ø",
"ō", "ō",
"ɔ", -- open o, open-mid back rounded vowel IPA "ɔ", -- open o, open-mid back rounded vowel IPA
"ɒ", -- turned alpha, open back rounded vowel IPA "œ",
}, },
_P_ = { _P_ = {
"P", "P",
west = "Π", -- uppercase pi north = "p",
northwest = "Π", -- Greek pi
west = "§", -- section sign
south = "",
southwest = "£", -- British pound currency
"Φ", -- Greek phi
"Ψ", -- Greek psi
}, },
_p_ = { _p_ = {
"p", "p",
west = "π", -- lowercase pi north = "P",
northwest = "π", -- Greek pi
west = "", -- pilcrow (paragraph) sign
south = "",
southwest = "£", -- British pound currency
"φ", -- Greek phi
"ψ", -- Greek psi
}, },
_Q_ = { _Q_ = {
"Q", "Q",
north = "[", north = "q",
northeast = "{", south = "",
--- @todo Render q̃ correctly on key (not a problem in textbox?)
--east = {"q̃"}, -- Old/Middle French abbreviation of que
}, },
_q_ = { _q_ = {
"q", "q",
north = "[", north = "Q",
northeast = "{", south = "",
--- @todo Render q̃ correctly on key (not a problem in textbox?)
--east = {"q̃"}, -- Old/Middle French abbreviation of que
}, },
_R_ = { _R_ = {
"R", "R",
north = "ρ", -- lowercase rho north = "r",
northeast = "Ŕ", northeast = "Ŕ",
northwest = "Ρ ", -- uppercase rho northwest = "® ",
east = "ɾ", -- alveolar flap or tap IPA east = "Ř", -- alveolar flap or tap IPA
west = "Ř", -- r with háček (Czech) west = "ɾ", -- r with háček (Czech)
south = "Ŗ", -- r cedilla (Latvian) south = "Ŗ", -- r cedilla (Latvian)
southeast = "ɻ", -- retroflex approximant IPA southeast = "ɻ", -- retroflex approximant IPA
southwest = "ɹ", -- alveolar approximant IPA southwest = "ɹ", -- alveolar approximant IPA
"ʀ", -- uvular trill IPA "ʀ", -- uvular trill IPA
"ʁ", -- voiced uvular fricative IPA "ʁ", -- voiced uvular fricative IPA
"", -- Russian ruble
}, },
_r_ = { _r_ = {
"r", "r",
north = "ρ", -- lowercase rho north = "R",
northeast = "ŕ", northeast = "ŕ",
northwest = "Ρ ", -- uppercase rho northwest = "® ",
east = "ɾ", -- alveolar flap or tap IPA east = "ř", -- alveolar flap or tap IPA
west = "ř", -- r with háček (Czech) west = "ɾ", -- r with háček (Czech)
south = "ŗ", -- r cedilla (Latvian) south = "ŗ", -- r cedilla (Latvian)
southeast = "ɻ", -- retroflex approximant IPA southeast = "ɻ", -- retroflex approximant IPA
southwest = "ɹ", -- alveolar approximant IPA southwest = "ɹ", -- alveolar approximant IPA
"ʀ", -- uvular trill IPA "ʀ", -- uvular trill IPA
"ʁ", -- voiced uvular fricative IPA "ʁ",
"", -- Russian ruble currency
}, },
_S_ = { _S_ = {
"S", "S",
north = "", -- uppercase eszett north = "s",
northeast = "Ś", northeast = "Ś",
northwest = "ʃ", -- esh, voiceless palato-alveolar fricative IPA northwest = "ʃ", -- esh, voiceless palato-alveolar fricative IPA
east = "Ŝ", east = "Ŝ",
west = "Š", west = "Š",
south = "Ş", south = "Ş",
southeast = "$", southeast = "", -- German eszett uppercase
southwest = "", southwest = "",
"",
"ſ", -- long s "ſ", -- long s
"Σ", -- uppercase sigma "Σ", -- Greek sigma
}, },
_s_ = { _s_ = {
"s", "s",
north = "ß", -- lowercase eszett north = "S",
northeast = "ś", northeast = "ś",
northwest = "ʃ", -- esh, voiceless palato-alveolar fricative IPA northwest = "ʃ", -- esh, voiceless palato-alveolar fricative IPA
east = "ŝ", east = "ŝ",
west = "š", west = "š",
south = "ş", south = "ş",
southeast = "$", southeast = "ß", -- German eszett
southwest = "", southwest = "",
"",
"ſ", -- long s "ſ", -- long s
"σ", -- lowercase sigma "σ", -- Greek sigma (beginning or the middle of the word)
"ς", -- lowercase word-end sigma
}, },
_T_ = { _T_ = {
"T", "T",
north = "θ", north = "t",
northeast = "Þ", northeast = "Þ",
northwest = "Ț", northwest = "Ț",
east = "Ʈ", east = "Ʈ",
west = "Ť", west = "Ť",
south = "Ţ", south = "Ţ",
southeast = "ʈ", southeast = "",
southwest = "", southwest = "",
"Τ", "", -- Kazakhstani tenge currency
"τ", "Θ", -- Greek theta
"Τ", -- Greek tau
}, },
_t_ = { _t_ = {
"t", "t",
north = "θ", north = "T",
northeast = "þ", northeast = "þ",
northwest = "ț", northwest = "ț",
east = "Ʈ", east = "ʈ",
west = "ť", west = "ť",
south = "ţ", south = "ţ",
southeast = "ʈ", southeast = "",
southwest = "", southwest = "",
"Τ", "", -- Kazakhstani tenge currency
"τ", "θ", -- Greek theta
"τ", -- Greek tau
}, },
_U_ = { _U_ = {
"U", "U",
north = "Ü", north = "u",
northeast = "Ú", northeast = "Ú",
northwest = "Ù", northwest = "Ù",
east = "Û", east = "Û",
west = "Ũ", west = "Ũ",
south = "Ų", south = "Ų",
southeast = "Ü",
southwest = "Ů", southwest = "Ů",
"Ū", "Ū",
"ʌ", -- turned v, open-mid back unrounded vowel IPA "ɒ", -- turned alpha, open back rounded vowel IPA
}, },
_u_ = { _u_ = {
"u", "u",
north = "ü", north = "U",
northeast = "ú", northeast = "ú",
northwest = "ù", northwest = "ù",
east = "û", east = "û",
west = "ũ", west = "ũ",
south = "ų", south = "ų",
southeast = "ü",
southwest = "ů", southwest = "ů",
"ū", "ū",
"ʌ", -- turned v, open-mid back unrounded vowel IPA "ɒ", -- turned alpha, open back rounded vowel IPA
}, },
_V_ = { _V_ = {
"V", "V",
north = "ʌ", -- open-mid back unrounded vowel IPA north = "v", -- open-mid back unrounded vowel IPA
northeast = "ʌ",
northwest = "Ʋ", -- v with hook northwest = "Ʋ", -- v with hook
east = "", east = "",
west = "", west = "",
}, },
_v_ = { _v_ = {
"v", "v",
north = "ʌ", -- open-mid back unrounded vowel IPA north = "V",
northeast = "ʌ", -- open-mid back unrounded vowel IPA
northwest = "ʋ", -- v with hook, labiodental approximant IPA northwest = "ʋ", -- v with hook, labiodental approximant IPA
east = "", east = "",
west = "", west = "",
}, },
_W_ = { _W_ = {
"W", "W",
north = "]", north = "w",
northeast = "}", west = "ʍ", -- inverted w, voiceless labial-velar approximant IPA
northwest = "ʍ", -- inverted w, voiceless labial-velar approximant IPA
east = "Ƿ", -- wynn, Old English for /w/ east = "Ƿ", -- wynn, Old English for /w/
}, },
_w_ = { _w_ = {
"w", "w",
north = "]", north = "W",
northeast = "}", west = "ʍ", -- inverted w, voiceless labial-velar approximant IPA
northwest = "ʍ", -- inverted w, voiceless labial-velar approximant IPA
east = "ƿ", -- wynn, Old English for /w/ east = "ƿ", -- wynn, Old English for /w/
}, },
_X_ = { _X_ = {
"X", "X",
east = "Χ", -- uppercase chi north = "x",
west = "Ξ", -- uppercase xi alt_label = "Σ",
northwest = "Η", -- Greek eta
northeast = "Ξ", -- Greek ksi
west = "Ο", -- Greek omicron
east = "Ρ", -- Greek rho
southwest = "Ε", -- Greek epsilon
south = "Χ", -- Greek chi
southeast = "Ω", -- Greek omega
"Α", -- Greek alpha
"Σ", -- Greek sigma
}, },
_x_ = { _x_ = {
"x", "x",
east = "χ", -- lowercase chi north = "X",
west = "ξ", -- lowercase xi alt_label = "Σ",
northwest = "η", -- Greek eta
northeast = "ξ", -- Greek ksi
west = "ο", -- Greek omicron
east = "ρ", -- Greek rho
southwest = "ε", -- Greek epsilon
south = "χ", -- Greek chi
southeast = "ω", -- Greek omega
"α", -- Greek alpha
"σ", -- Greek sigma (beginning or the middle of the word)
"ς", -- Greek sigma (end of the word)
}, },
_Y_ = { _Y_ = {
"Y", "Y",
north = "Ŷ", north = "y",
northeast = "Ý", northeast = "Ý",
northwest = "", northwest = "",
east = "Ÿ", east = "Ÿ",
west = "", west = "",
south = "ʎ", -- palatal lateral approximant IPA (looks like mirror lambda, but actually upside down y) south = "ʎ", -- palatal lateral approximant IPA (looks like mirror lambda, but actually upside down y)
southeast = "ʏ", -- near-close, near-front rounded vowel IPA southeast = "ʏ", -- near-close, near-front rounded vowel IPA
southwest = "Υ", -- uppercase upsilon southwest = "Ŷ",
"¥", -- Japanese Yen/Chinese Yuan currency
"Τ", -- Greek upsilon
}, },
_y_ = { _y_ = {
"y", "y",
north = "ŷ", north = "Y",
northeast = "ý", northeast = "ý",
northwest = "", northwest = "",
east = "ÿ", east = "ʏ", -- near-close, near-front rounded vowel IPA
west = "", west = "",
south = "ʎ", -- palatal lateral approximant IPA (looks like mirror lambda, but actually upside down y) south = "ʎ", -- palatal lateral approximant IPA (looks like mirror lambda, but actually upside down y)
southeast = "ʏ", -- near-close, near-front rounded vowel IPA southeast = "ÿ",
southwest = "υ", -- lowercase upsilon southwest = "ŷ",
"¥",
"υ", -- Greek upsilon
}, },
_Z_ = { _Z_ = {
"Z", "Z",
northeast = "Ź", north = "z",
northwest = "Ζ", -- zeta uppercase northeast = "Ζ", -- Greek zeta
east = "Ź",
west = "Ž", west = "Ž",
south = "ʐ", -- voiced retroflex sibilant fricative IPA south = "ʐ", -- voiced retroflex sibilant fricative IPA
southeast = "ʒ", -- ezh, voiced palato-alveolar fricative IPA southeast = "ʒ", -- ezh, voiced palato-alveolar fricative IPA
@ -504,11 +622,120 @@ return {
}, },
_z_ = { _z_ = {
"z", "z",
northeast = "ź", north = "Z",
northwest = "ζ", -- zeta lowercase northeast = "ζ", -- Greek zeta
east = "ź",
west = "ž", west = "ž",
south = "ʐ", -- voiced retroflex sibilant fricative IPA south = "ʐ", -- voiced retroflex sibilant fricative IPA
southeast = "ʒ", -- ezh, voiced palato-alveolar fricative IPA southeast = "ʒ", -- ezh, voiced palato-alveolar fricative IPA
southwest = "ż", southwest = "ż",
}, },
-- _1_ and _1p: numeric key 1 and its popup sibling (they have north swipe ups of each other, the rest is the same)
-- _1n and _1s: numpad key 1 (layer 2), -- superscript key 1 (layer 2, shifted)
_1_ = { "1", north = "!", alt_label = "!", northeast = "¡", south = "'", southeast = "¿", east = "?", },
_1p = { "!", north = "1", alt_label = "1", northeast = "¡", south = "'", southeast = "¿", east = "?", },
_1n = { "1", north = "¹", northeast = "", northwest = "", east = "", west = "¼", south = "", southwest = "½", southeast = "", "", "", "", },
_1s = { "¹", north = "1", northeast = "", northwest = "", east = "", west = "¼", south = "", southwest = "½", southeast = "", "", "", "", },
_2_ = { "2", north = "@", alt_label = "@", northeast = "~", northwest = "http://", east = "-", west = "https://", south = '"', southeast = "", southwest = "/", },
_2p = { "@", north = "2", alt_label = "2", northeast = "~", northwest = "http://", east = "-", west = "https://", south = '"', southeast = "", southwest = "/", },
_2n = { "2", north = "²", northeast = "", east = "½", south = "", southeast = "", }, -- numpad 2
_2s = { "²", north = "2", northeast = "", east = "½", south = "", southeast = "", }, -- superscript 2
_3_ = { "3", north = "#", alt_label = "#", northeast = "", northwest = "", east = "", west = "", south = "", southeast = "", southwest = "", ":)", ":|", ":(", },
_3p = { "#", north = "3", alt_label = "3", northeast = "", northwest = "", east = "", west = "", south = "", southeast = "", southwest = "", ":)", ":|", ":(", },
_3n = { "3", north = "³", northwest = "¾", east = "", west = "", southwest = "", south = "", }, -- numpad 3
_3s = { "³", north = "3", northwest = "¾", east = "", west = "", southwest = "", south = "", }, -- superscript 3
_4_ = { "4", north = "$", alt_label = "$", northeast = "", northwest = "¥", east = "", west = "£", south = "", southeast = "¢", southwest = "", "", "", "", },
_4p = { "$", north = "4", alt_label = "4", northeast = "", northwest = "¥", east = "", west = "£", south = "", southeast = "¢", southwest = "", "", "", "", },
_4n = { "4", north = "", east = "¼", south = "", southeast = "", }, -- numpad 4
_4s = { "", north = "4", east = "¼", south = "", southeast = "", }, -- superscript 4
_5_ = { "5", north = "%", alt_label = "%", northeast = "", northwest = "", east = "", west = "¼", south = "½", southeast = "", southwest = "¾", },
_5p = { "%", north = "5", alt_label = "5", northeast = "", northwest = "", east = "", west = "¼", south = "½", southeast = "", southwest = "¾", },
_5n = { "5", north = "", northeast = "", east = "", south = "", southeast = "", }, -- numpad 5
_5s = { "", north = "5", northeast = "", east = "", south = "", southeast = "", }, -- superscript 5
-- diacritics. Symbols in quotation marks might look weird, however they should work fine.
_6_ = {
"6",
north = "^",
alt_label = "^",
northeast = { label = "◌́", key = "́", }, -- Combining Acute Accent
northwest = { label = "◌̀", key = "̀", }, -- Combinig Grave Accent
east = { label = "◌̂", key = "̂", }, -- Combining Circumflex Accent
west = { label = "◌̃", key = "̃", }, -- Combining Tilde
south = { label = "◌̧", key = "̧", }, -- Combining Cedilla
southeast = { label = "◌̈", key = "̈", }, -- Combining Diaeresis (Umlaut)
southwest = { label = "◌̇", key = "̇", }, -- Combining Dot Above
{ label = "◌̄", key = "̄", }, -- Combining Macron
{ label = "◌̌", key = "̌", }, -- Combining Caron
{ label = "◌̨", key = "̨", }, -- Combining Ogonek
},
_6p = {
"^",
north = "6",
alt_label = "6",
northeast = { label = "◌́", key = "́", }, -- Combining Acute Accent
northwest = { label = "◌̀", key = "̀", }, -- Combinig Grave Accent
east = { label = "◌̂", key = "̂", }, -- Combining Circumflex Accent
west = { label = "◌̃", key = "̃", }, -- Combining Tilde
south = { label = "◌̧", key = "̧", }, -- Combining Cedilla
southeast = { label = "◌̈", key = "̈", }, -- Combining Diaeresis (Umlaut)
southwest = { label = "◌̇", key = "̇", }, -- Combining Dot Above
{ label = "◌̄", key = "̄", }, -- Combining Macron
{ label = "◌̌", key = "̌", }, -- Combining Caron
{ label = "◌̨", key = "̨", }, -- Combining Ogonek
},
_6n = { "6", north = "", east = "", south = "", }, -- numpad 6
_6s = { "", north = "6", east = "", south = "", }, -- superscript 6
_7_ = { "7", north = "&", alt_label = "&", northeast = "»", northwest = "«", east = "", west = "§", south = "¤", southeast = "", southwest = "", "", "", "", },
_7p = { "&", north = "7", alt_label = "7", northeast = "»", northwest = "«", east = "", west = "§", south = "¤", southeast = "", southwest = "", "", "", "", },
_7n = { "7", north = "", east = "", south = "", southeast = "", }, -- numpad 7
_7s = { "", north = "7", east = "", south = "", southeast = "", }, -- superscript 7
_8_ = { "8", north = "*", alt_label = "*", northeast = "=", northwest = "", east = "+", west = "-", south = "/", southeast = ">", southwest = "<", "", "", "", },
_8p = { "*", north = "8", alt_label = "8", northeast = "=", northwest = "", east = "+", west = "-", south = "/", southeast = ">", southwest = "<", "", "", "", },
_8n = { "8", north = "", east = "", south = "", }, -- numpad 8
_8s = { "", north = "8", east = "", south = "", }, -- superscript 8
_9_ = { "9", north = "(", alt_label = "(", northeast = "_", northwest = "", east = "-", west = "{", south = "[", southeast = "", southwest = "", },
_9p = { "(", north = "9", alt_label = "9", northeast = "_", northwest = "", east = "-", west = "{", south = "[", southeast = "", southwest = "", },
_9n = { "9", north = "", east = "", south = "", }, -- numpad 9
_9s = { "", north = "9", east = "", south = "", }, -- superscript 9
_0_ = { "0", north = ")", alt_label = ")", northwest = "", west = "}", south = "]", southwest = "", },
_0p = { ")", north = "0", alt_label = "0", northwest = "", west = "}", south = "]", southwest = "", },
_0n = { "0", north = "", south = "", }, -- numpad 0
_0s = { "", north = "0", south = "", }, -- superscript 0
sla = { "/", north = "÷", alt_label = "÷", northeast = "", east = "", }, -- numpad slash
sl2 = { "÷", north = "/", alt_label = "/", northeast = "", east = "", }, -- superscript slash
eql = { "=", north = "", alt_label = "", northwest = "", west = "", south = "", southwest = "", }, -- equality
eq2 = { "", north = "=", alt_label = "=", northwest = "", west = "", south = "", southwest = "", }, -- popup sibling
ls1 = { "<", north = "", alt_label = "", south = "", }, -- "less than" sign
ls2 = { "", north = "<", alt_label = "<", south = "", }, -- (popup sibling)
mr1 = { ">", north = "", alt_label = "", south = "", }, -- "more than"
mr2 = { "", north = ">", alt_label = ">", south = "", }, -- (popup sibling)
pls = { "+", north = "±", alt_label = "±", }, -- plus sign
pl2 = { "±", north = "+", alt_label = "+", }, -- (popup sibling)
mns = { "-", north = "", alt_label = "", }, -- minus sign
mn2 = { "", north = "-", alt_label = "-", }, -- (popup sibling)
dsh = { "-", north = "", alt_label = "", south = "", }, -- dashes
dgr = { "", north = "", alt_label = "", }, -- dagger
tpg = { "", north = "§", alt_label = "§", northeast = "", northwest = "", east = "¤", west = "", south = "®", southeast = "🄯", southwest = "©", }, -- typography symbols
mth = { "", north = "",alt_label = "", northeast = "", northwest = "", east = "", west = "", south = "", southeast = "", southwest = "", "", "", "", }, -- math operations 1
mt2 = { "", north = "", alt_label = "", northeast = "", northwest = "", east = "𝔸", west = "", south = "𝕀", southeast = "", southwest = "𝕌", "", "", "", }, -- math operations 2
int = { "", north = "", alt_label = "", northeast = "", northwest = "", east = "", west = "", south = "", southeast = "", southwest = "", "", "", "", }, -- integrals
dif = { "", north = "", alt_label = "", northeast = "", east = "", south = "", southeast = "", }, -- math operations 3
df2 = { "", north = "", alt_label = "", northeast = "", northwest = "", east = "", west = "", }, -- math operations 4
pdc = { "*", north = "", alt_label = "", south = "", }, -- asterisk, cross-product and dot-prodcuts symbols
pd2 = { "", north = "*", alt_label = "*", south = "", },
bar = { "|", north = "¦", alt_label = "¦", }, -- bars like pipe and broken bar
prm = { "", north = "", alt_label = "", }, -- per mile types
hsh = { "#", north = "", alt_label = "", }, -- hash and "No." sign
hs2 = { "", north = "#", alt_label = "#", },
} }

@ -1,99 +1,255 @@
return { return {
_Je_ = { pco = { -- period + colon
"Ж", ".",
north = "Ӂ", -- Ж with breve (Moldavian) north = ":",
}, alt_label = ":",
_je_ = {
"ж",
north = "ӂ", -- ж with breve (Moldavian)
},
_Ye_ = {
"Е",
north = "Ё",
},
_ye_ = {
"е",
north = "ё",
},
_SH_ = {
"Ь",
north = "Ъ",
},
_sh_ = {
"ь",
north = "ъ",
},
--
_KA_ = {
"А",
north = "Ә",
},
_ka_ = {
"а",
north = "ә",
},
_KI_ = {
"Ы",
north = "І",
},
_ki_ = {
"ы",
north = "і",
},
_KN_ = {
"Н",
north = "Ң",
},
_kn_ = {
"н",
north = "ң",
},
_KG_ = {
"Г",
north = "Ғ",
},
_kg_ = {
"г",
north = "ғ",
},
_KU_ = {
"У",
north = "Ү",
northeast = "Ұ",
},
_ku_ = {
"у",
north = "ү",
northeast = "ұ",
},
_KK_ = {
"К",
north = "Қ",
},
_kk_ = {
"к",
north = "қ",
},
_KO_ = {
"О",
north = "Ө",
},
_ko_ = {
"о",
north = "ө",
},
_KH_ = {
"Х",
north = "Һ",
},
_kh_ = {
"х",
north = "һ",
},
_qe_ = {
"?",
north = "!",
northwest = '"',
northeast = "'", northeast = "'",
}, northwest = "=",
east = "!",
west = "?",
south = "|",
southeast = "\\",
southwest = "/",
'^',
"&",
"$",
},
cop = { -- colon + period
":",
north = ".",
alt_label = ".",
northeast = "'",
northwest = "=",
east = "!",
west = "?",
south = "|",
southeast = "\\",
southwest = "/",
'^',
"&",
"$",
},
quo = {
'"',
north = "'",
alt_label = "'",
northeast = "»",
northwest = "«",
east = "",
west = "",
south = "`",
southeast = "",
southwest = "",
"",
"",
},
cse = { -- comma + semicolon
",",
north = ";",
alt_label = ";",
northeast = "}",
northwest = "{",
east = { label = "!…", key = "!important;" },
west = "-",
south = "*",
southwest = "0",
southeast = ">",
"[",
"+",
"]",
width = 1.0,
},
sec = { -- semicolon + comma
";",
north = ",",
alt_label = ",",
northeast = "}",
northwest = "{",
east = { label = "!…", key = "!important;" },
west = "-",
south = "*",
southwest = "0",
southeast = ">",
"[",
"*",
"]",
width = 1.0,
},
-- Russian layout, top row of letters (11 keys): й ц у к е/ё н г ш щ з х
_YK = { "Й", north = "й", },
_yk = { "й", north = "Й", },
_TS = { "Ц", north = "ц", },
_ts = { "ц", north = "Ц", },
_UU = { "У", north = "у", northeast = "ұ", east = "Ұ", }, -- with Kazakh letter(s)
_uu = { "у", north = "У", northeast = "Ұ", east = "ұ", }, -- with Kazakh letter(s)
_KK = { "К", north = "к", northeast = "қ", east = "Қ", }, -- with Kazakh letter(s)
_kk = { "к", north = "К", northeast = "Қ", east = "қ", }, -- with Kazakh letter(s)
_YE = { "Е", north = "е", northwest = "ё", west = "Ё", },
_ye = { "е", north = "Е", northwest = "Ё", west = "ё", },
_EN = { "Н", north = "н", northeast = "ң", east = "Ң", }, -- with Kazakh letter(s)
_en = { "н", north = "Н", northeast = "Ң", east = "ң", }, -- with Kazakh letter(s)
_GG = { "Г", north = "г", northeast = "ғ", northwest = "ґ", east = "Ғ", west = "Ґ", }, -- with Kazakh and Ukrainian letter(s)
_gg = { "г", north = "Г", northeast = "Ғ", northwest = "Ґ", east = "ғ", west = "ґ", }, -- with Kazakh and Ukrainian letter(s)
_WA = { "Ш", north = "ш", },
_wa = { "ш", north = "Ш", },
_WE = { "Щ", north = "щ", },
_we = { "щ", north = "Щ", },
_ZE = { "З", north = "з", },
_ze = { "з", north = "З", },
_HA = { "Х", north = "х", northeast = "һ", east = "Һ", }, -- with Kazakh letter(s)
_ha = { "х", north = "Х", northeast = "Һ", east = "һ", }, -- with Kazakh letter(s)
-- Russian layout, middle row of letters (11 keys): ф ы в а п р о л д ж э
_EF = { "Ф", north = "ф", },
_ef = { "ф", north = "Ф", },
_YY = { "Ы", north = "ы", northwest = "і", west = "І", },
_yy = { "ы", north = "Ы", northwest = "І", west = "і", },
_VE = { "В", north = "в", },
_ve = { "в", north = "В", },
_AA = { "А", north = "а", northeast = "ә", east = "Ә", }, -- with Kazakh letter(s)
_aa = { "а", north = "А", northeast = "Ә", east = "ә", }, -- with Kazakh letter(s)
_PE = { "П", north = "п", },
_pe = { "п", north = "П", },
_ER = { "Р", north = "р", },
_er = { "р", north = "Р", },
_OO = { "О", north = "о", northeast = "ө", east = "Ө", }, -- with Kazakh letter(s)
_oo = { "о", north = "О", northeast = "Ө", east = "ө", }, -- with Kazakh letter(s)
_EL = { "Л", north = "л", },
_el = { "л", north = "Л", },
_DE = { "Д", north = "д", },
_de = { "д", north = "Д", },
_JE = { "Ж", north = "ж", northwest = "ӂ", west = "Ӂ", }, -- Ж with breve (Moldavian)
_je = { "ж", north = "Ж", northwest = "Ӂ", west = "ӂ", }, -- ж with breve (Moldavian)
_EE = { "Э", north = "э", northwest = "є", west = "Є", }, -- with Ukrainian letter(s)
_ee = { "э", north = "Э", northwest = "Є", west = "є", }, -- with Ukrainian letter(s)
-- Russian layout, bottom row of letters (9 keys): я ч с м и т ь/ъ б ю
_YA = { "Я", north = "я", }, -- width is changed is that Shift and Backspace can be 1.5 wide
_ya = { "я", north = "Я", },
_CH = { "Ч", north = "ч", },
_ch = { "ч", north = "Ч", },
_ES = { "С", north = "с", },
_es = { "с", north = "С", },
_EM = { "М", north = "м", },
_em = { "м", north = "М", },
_II = { "И", north = "и", northeast = "і", northwest = "ї", west = "ї", east = "і", }, -- with Kazakh and Ukrainian letter(s)
_ii = { "и", north = "И", northeast = "I", northwest = "Ї", west = "ї", east = "і", }, -- with Kazakh and Ukrainian letter(s)
_TE = { "Т", north = "т", },
_te = { "т", north = "Т", },
_SH = { "Ь", north = "ь", northwest = "ъ", west = "Ъ", },
_sh = { "ь", north = "Ь", northwest = "Ъ", west = "ъ", },
_BE = { "Б", north = "б", },
_be = { "б", north = "Б", },
_YU = { "Ю", north = "ю", northeast = "ү", east = "Ү", }, -- with Kazakh letter(s)
_yu = { "ю", north = "Ю", northeast = "Ү", east = "ү", }, -- with Kazakh letter(s)
-- _1_ and _1p: numeric key 1 and its popup sibling (they have north swipe ups of each other, the rest is the same)
-- _1n and _1s: numpad key 1 (layer 2), -- superscript key 1 (layer 2, shifted)
_1_ = { "1", north = "!", alt_label = "!", northeast = "¡", south = "'", southeast = "¿", east = "?", },
_1p = { "!", north = "1", alt_label = "1", northeast = "¡", south = "'", southeast = "¿", east = "?", },
_1n = { "1", north = "¹", northeast = "", northwest = "", east = "", west = "¼", south = "", southwest = "½", southeast = "", "", "", "", },
_1s = { "¹", north = "1", northeast = "", northwest = "", east = "", west = "¼", south = "", southwest = "½", southeast = "", "", "", "", },
_2_ = { "2", north = "@", alt_label = "@", northeast = "~", northwest = "http://", east = "-", west = "https://", south = '"', southeast = "", southwest = "/", },
_2p = { "@", north = "2", alt_label = "2", northeast = "~", northwest = "http://", east = "-", west = "https://", south = '"', southeast = "", southwest = "/", },
_2n = { "2", north = "²", northeast = "", east = "½", south = "", southeast = "", }, -- numpad 2
_2s = { "²", north = "2", northeast = "", east = "½", south = "", southeast = "", }, -- superscript 2
_3_ = { "3", north = "#", alt_label = "#", northeast = "", northwest = "", east = "", west = "", south = "", southeast = "", southwest = "", ":)", ":|", ":(", },
_3p = { "#", north = "3", alt_label = "3", northeast = "", northwest = "", east = "", west = "", south = "", southeast = "", southwest = "", ":)", ":|", ":(", },
_3n = { "3", north = "³", northwest = "¾", east = "", west = "", southwest = "", south = "", }, -- numpad 3
_3s = { "³", north = "3", northwest = "¾", east = "", west = "", southwest = "", south = "", }, -- superscript 3
_4_ = { "4", north = "$", alt_label = "$", northeast = "", northwest = "¥", east = "", west = "£", south = "", southeast = "¢", southwest = "", "", "", "", },
_4p = { "$", north = "4", alt_label = "4", northeast = "", northwest = "¥", east = "", west = "£", south = "", southeast = "¢", southwest = "", "", "", "", },
_4n = { "4", north = "", east = "¼", south = "", southeast = "", }, -- numpad 4
_4s = { "", north = "4", east = "¼", south = "", southeast = "", }, -- superscript 4
_5_ = { "5", north = "%", alt_label = "%", northeast = "", northwest = "", east = "", west = "¼", south = "½", southeast = "", southwest = "¾", },
_5p = { "%", north = "5", alt_label = "5", northeast = "", northwest = "", east = "", west = "¼", south = "½", southeast = "", southwest = "¾", },
_5n = { "5", north = "", northeast = "", east = "", south = "", southeast = "", }, -- numpad 5
_5s = { "", north = "5", northeast = "", east = "", south = "", southeast = "", }, -- superscript 5
-- diacritics. Symbols in quotation marks might look weird, however they should work fine.
_6_ = {
"6",
north = "^",
alt_label = "^",
northeast = { label = "◌́", key = "́", }, -- Combining Acute Accent
northwest = { label = "◌̀", key = "̀", }, -- Combinig Grave Accent
east = { label = "◌̂", key = "̂", }, -- Combining Circumflex Accent
west = { label = "◌̃", key = "̃", }, -- Combining Tilde
south = { label = "◌̧", key = "̧", }, -- Combining Cedilla
southeast = { label = "◌̈", key = "̈", }, -- Combining Diaeresis (Umlaut)
southwest = { label = "◌̇", key = "̇", }, -- Combining Dot Above
{ label = "◌̄", key = "̄", }, -- Combining Macron
{ label = "◌̌", key = "̌", }, -- Combining Caron
{ label = "◌̨", key = "̨", }, -- Combining Ogonek
},
_6p = {
"^",
north = "6",
alt_label = "6",
northeast = { label = "◌́", key = "́", }, -- Combining Acute Accent
northwest = { label = "◌̀", key = "̀", }, -- Combinig Grave Accent
east = { label = "◌̂", key = "̂", }, -- Combining Circumflex Accent
west = { label = "◌̃", key = "̃", }, -- Combining Tilde
south = { label = "◌̧", key = "̧", }, -- Combining Cedilla
southeast = { label = "◌̈", key = "̈", }, -- Combining Diaeresis (Umlaut)
southwest = { label = "◌̇", key = "̇", }, -- Combining Dot Above
{ label = "◌̄", key = "̄", }, -- Combining Macron
{ label = "◌̌", key = "̌", }, -- Combining Caron
{ label = "◌̨", key = "̨", }, -- Combining Ogonek
},
_6n = { "6", north = "", east = "", south = "", }, -- numpad 6
_6s = { "", north = "6", east = "", south = "", }, -- superscript 6
_7_ = { "7", north = "&", alt_label = "&", northeast = "»", northwest = "«", east = "", west = "§", south = "¤", southeast = "", southwest = "", "", "", "", },
_7p = { "&", north = "7", alt_label = "7", northeast = "»", northwest = "«", east = "", west = "§", south = "¤", southeast = "", southwest = "", "", "", "", },
_7n = { "7", north = "", east = "", south = "", southeast = "", }, -- numpad 7
_7s = { "", north = "7", east = "", south = "", southeast = "", }, -- superscript 7
_8_ = { "8", north = "*", alt_label = "*", northeast = "=", northwest = "", east = "+", west = "-", south = "/", southeast = ">", southwest = "<", "", "", "", },
_8p = { "*", north = "8", alt_label = "8", northeast = "=", northwest = "", east = "+", west = "-", south = "/", southeast = ">", southwest = "<", "", "", "", },
_8n = { "8", north = "", east = "", south = "", }, -- numpad 8
_8s = { "", north = "8", east = "", south = "", }, -- superscript 8
_9_ = { "9", north = "(", alt_label = "(", northeast = "_", northwest = "", east = "-", west = "{", south = "[", southeast = "", southwest = "", },
_9p = { "(", north = "9", alt_label = "9", northeast = "_", northwest = "", east = "-", west = "{", south = "[", southeast = "", southwest = "", },
_9n = { "9", north = "", east = "", south = "", }, -- numpad 9
_9s = { "", north = "9", east = "", south = "", }, -- superscript 9
_0_ = { "0", north = ")", alt_label = ")", northwest = "", west = "}", south = "]", southwest = "", },
_0p = { ")", north = "0", alt_label = "0", northwest = "", west = "}", south = "]", southwest = "", },
_0n = { "0", north = "", south = "", }, -- numpad 0
_0s = { "", north = "0", south = "", }, -- superscript 0
sla = { "/", north = "÷", alt_label = "÷", northeast = "", east = "", }, -- numpad slash
sl2 = { "÷", north = "/", alt_label = "/", northeast = "", east = "", }, -- superscript slash
eql = { "=", north = "", alt_label = "", northwest = "", west = "", south = "", southwest = "", }, -- equality
eq2 = { "", north = "=", alt_label = "=", northwest = "", west = "", south = "", southwest = "", }, -- popup sibling
ls1 = { "<", north = "", alt_label = "", south = "", }, -- "less than" sign
ls2 = { "", north = "<", alt_label = "<", south = "", }, -- (popup sibling)
mr1 = { ">", north = "", alt_label = "", south = "", }, -- "more than"
mr2 = { "", north = ">", alt_label = ">", south = "", }, -- (popup sibling)
pls = { "+", north = "±", alt_label = "±", }, -- plus sign
pl2 = { "±", north = "+", alt_label = "+", }, -- (popup sibling)
mns = { "-", north = "", alt_label = "", }, -- minus sign
mn2 = { "", north = "-", alt_label = "-", }, -- (popup sibling)
dsh = { "-", north = "", alt_label = "", south = "", }, -- dashes
dgr = { "", north = "", alt_label = "", }, -- dagger
tpg = { "", north = "§", alt_label = "§", northeast = "", northwest = "", east = "¤", west = "", south = "®", southeast = "🄯", southwest = "©", }, -- typography symbols
mth = { "", north = "", alt_label = "", northeast = "", northwest = "", east = "", west = "", south = "", southeast = "", southwest = "", "", "", "", }, -- math operations 1
mt2 = { "", north = "", alt_label = "", northeast = "", northwest = "", east = "𝔸", west = "", south = "𝕀", southeast = "", southwest = "𝕌", "", "", "", }, -- math operations 2
int = { "", north = "", alt_label = "", northeast = "", northwest = "", east = "", west = "", south = "", southeast = "", southwest = "", "", "", "", }, -- integrals
dif = { "", north = "", alt_label = "", northeast = "", east = "", south = "", southeast = "", }, -- math operations 3
df2 = { "", north = "", alt_label = "", northeast = "", northwest = "", east = "", west = "", }, -- math operations 4
pdc = { "*", north = "", alt_label = "", south = "", }, -- asterisk, cross-product and dot-prodcuts symbols
pd2 = { "", north = "*", alt_label = "*", south = "", },
bar = { "|", north = "¦", alt_label = "¦", }, -- bars like pipe and broken bar
prm = { "", north = "", alt_label = "", }, -- per mile types
hsh = { "#", north = "", alt_label = "", }, -- hash and "No." sign
hs2 = { "", north = "#", alt_label = "#", },
} }

@ -3,49 +3,56 @@ local pl_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayou
local keys = pl_keyboard.keys local keys = pl_keyboard.keys
-- Umlaut keys on standard keyboard
keys[1][3][5] = 'Ę'
keys[1][3][6] = 'ę'
keys[1][9][5] = 'Ó'
keys[1][9][6] = 'ó'
keys[2][1][5] = 'Ą'
keys[2][1][6] = 'ą'
keys[2][2][5] = 'Ś'
keys[2][2][6] = 'ś'
keys[2][9][5] = 'Ł'
keys[2][9][6] = 'ł'
keys[3][2][5] = 'Ż'
keys[3][2][6] = 'ż'
keys[3][3][5] = 'Ź'
keys[3][3][6] = 'ź'
keys[3][4][5] = 'Ć'
keys[3][4][6] = 'ć'
keys[3][7][5] = 'Ń'
keys[3][7][6] = 'ń'
-- popup keyboard - move polish characters to east -- popup keyboard - move polish characters to east
keys[1][3][1].east = 'Ę'; keys[1][3][1].south = 'Ê' --keys[2][3][1].east = 'Ę'; keys[1][3][1].south = 'Ê'
keys[1][3][2].east = 'ę'; keys[1][3][2].south = 'ê' --keys[2][3][2].east = 'ę'; keys[1][3][2].south = 'ê'
keys[1][9][1].east = 'Ó'; keys[1][9][1].northeast = 'Ô' keys[2][3][1].east, keys[2][3][1].south = keys[2][3][1].south, keys[2][3][1].east
keys[1][9][2].east = 'ó'; keys[1][9][2].northeast = 'ô' keys[2][3][2].east, keys[2][3][2].south = keys[2][3][2].south, keys[2][3][2].east
keys[2][1][1].east = 'Ą'; keys[2][1][1].south = 'Â'
keys[2][1][2].east = 'ą'; keys[2][1][2].south = 'â' -- keys[2][9][1].east = 'Ó'; keys[1][9][1].northeast = 'Ô'
keys[2][2][1].east = 'Ś'; keys[2][2][1].northeast = 'Ŝ' -- keys[2][9][2].east = 'ó'; keys[1][9][2].northeast = 'ô'
keys[2][2][2].east = 'ś'; keys[2][2][2].northeast = 'ŝ' keys[2][9][1].east, keys[2][9][1].south = keys[2][9][1].south, keys[2][9][1].east
keys[2][9][1].east = 'Ł'; keys[2][9][1].west = '+' keys[2][9][2].east, keys[2][9][2].south = keys[2][9][2].south, keys[2][9][2].east
keys[2][9][2].east = 'ł'; keys[2][9][2].west = '+'
keys[3][2][1].east = 'Ż'; keys[3][2][1].southwest = '' -- keys[3][1][1].east = 'Ą'; keys[2][1][1].south = 'Â'
keys[3][2][1].west = 'Ź'; keys[3][2][1].northeast = 'Ž' -- keys[3][1][2].east = 'ą'; keys[2][1][2].south = 'â'
keys[3][2][2].east = 'ż'; keys[3][2][2].southwest = '' keys[3][1][1].east, keys[3][1][1].south = keys[3][1][1].south, keys[3][1][1].east
keys[3][2][2].west = 'ź'; keys[3][2][2].northeast = 'ž' keys[3][1][2].east, keys[3][1][2].south = keys[3][1][2].south, keys[3][1][2].east
keys[3][3][1].east = 'Ź'; keys[3][3][1].north = 'Χ'
keys[3][3][2].east = 'ź'; keys[3][3][2].north = 'χ' -- keys[3][2][1].east = 'Ś'; keys[2][2][1].northeast = 'Ŝ'
keys[3][4][1].east = 'Ć'; keys[3][4][1].northeast = 'Ĉ' -- keys[3][2][2].east = 'ś'; keys[2][2][2].northeast = 'ŝ'
keys[3][4][2].east = 'ć'; keys[3][4][2].northeast = 'ĉ' keys[3][2][1].east, keys[3][2][1].northeast = keys[3][2][1].northeast, keys[3][2][1].east
keys[3][7][1].east = 'Ń'; keys[3][7][1].northeast = 'ɲ' keys[3][2][2].east, keys[3][2][2].northeast = keys[3][2][2].northeast, keys[3][2][2].east
keys[3][7][2].east = 'ń'; keys[3][7][2].northeast = 'ɲ'
-- keys[3][9][1].east = 'Ł'; keys[2][9][1].west = '+'
-- keys[3][9][2].east = 'ł'; keys[2][9][2].west = '+'
keys[3][9][1].east, keys[3][9][1].west = keys[3][9][1].west, keys[3][9][1].east
keys[3][9][2].east, keys[3][9][2].west = keys[3][9][2].west, keys[3][9][2].east
-- keys[4][2][1].east = 'Ż'; keys[3][2][1].southwest = ''
-- keys[4][2][2].east = 'ż'; keys[3][2][2].southwest = ''
keys[4][2][1].west, keys[4][2][1].southwest = keys[4][2][1].southwest, keys[4][2][1].west
keys[4][2][2].west, keys[4][2][2].southwest = keys[4][2][2].southwest, keys[4][2][2].west
-- keys[4][2][1].west = 'Ź'; keys[3][2][1].northeast = 'Ž'
-- keys[4][2][2].west = 'ź'; keys[3][2][2].northeast = 'ž'
-- ?
-- keys[4][3][1].east = 'Ź'; keys[3][3][1].north = 'Χ'
-- keys[4][3][2].east = 'ź'; keys[3][3][2].north = 'χ'
-- ?
-- keys[4][4][1].east = 'Ć'; keys[3][4][1].northeast = 'Ĉ'
-- keys[4][4][2].east = 'ć'; keys[3][4][2].northeast = 'ĉ'
keys[4][4][1].east, keys[4][4][1].northeast = keys[4][4][1].northeast, keys[4][4][1].east
keys[4][4][2].east, keys[4][4][2].northeast = keys[4][4][2].northeast, keys[4][4][2].east
-- keys[4][7][1].east = 'Ń'; keys[3][7][1].northeast = 'ɲ'
-- keys[4][7][2].east = 'ń'; keys[3][7][2].northeast = 'ɲ'
keys[4][7][1].east, keys[4][7][1].northeast = keys[4][7][1].northeast, keys[4][7][1].east
keys[4][7][2].east, keys[4][7][2].northeast = keys[4][7][2].northeast, keys[4][7][2].east
-- space -- space
keys[4][4].label = "" keys[5][4].label = ""
return pl_keyboard return pl_keyboard

@ -1,112 +1,215 @@
local en_popup = require("ui/data/keyboardlayouts/keypopup/en_popup")
local ru_popup = require("ui/data/keyboardlayouts/keypopup/ru_popup") local ru_popup = require("ui/data/keyboardlayouts/keypopup/ru_popup")
local com = en_popup.com -- comma (,) local pco = ru_popup.pco
local prd = en_popup.prd -- period (.) local cop = ru_popup.cop
local _at = en_popup._at local cse = ru_popup.cse
local _eq = en_popup._eq -- equals sign (=) local sec = ru_popup.sec
local _Je_ = ru_popup._Je_ local quo = ru_popup.quo
local _je_ = ru_popup._je_ -- Russian layout, top row of letters
local _Ye_ = ru_popup._Ye_ local _YK = ru_popup._YK
local _ye_ = ru_popup._ye_ local _yk = ru_popup._yk
local _TS = ru_popup._TS
-- the Russian soft/hard sign local _ts = ru_popup._ts
local _SH_ = ru_popup._SH_ local _UU = ru_popup._UU
local _sh_ = ru_popup._sh_ local _uu = ru_popup._uu
local _KK = ru_popup._KK
-- Kazakh Cyrillic letters: ә і ң ғ ү ұ қ ө һ local _kk = ru_popup._kk
local _KA_ = ru_popup._KA_ local _YE = ru_popup._YE
local _ka_ = ru_popup._ka_ local _ye = ru_popup._ye
local _KI_ = ru_popup._KI_ local _EN = ru_popup._EN
local _ki_ = ru_popup._ki_ local _en = ru_popup._en
local _KN_ = ru_popup._KN_ local _GG = ru_popup._GG
local _kn_ = ru_popup._kn_ local _gg = ru_popup._gg
local _KG_ = ru_popup._KG_ local _WA = ru_popup._WA
local _kg_ = ru_popup._kg_ local _wa = ru_popup._wa
local _KU_ = ru_popup._KU_ local _WE = ru_popup._WE
local _ku_ = ru_popup._ku_ local _we = ru_popup._we
local _KK_ = ru_popup._KK_ local _ZE = ru_popup._ZE
local _kk_ = ru_popup._kk_ local _ze = ru_popup._ze
local _KO_ = ru_popup._KO_ local _HA = ru_popup._HA
local _ko_ = ru_popup._ko_ local _ha = ru_popup._ha
local _KH_ = ru_popup._KH_ -- Russian layout, middle row of letters
local _kh_ = ru_popup._kh_ local _EF = ru_popup._EF
local _ef = ru_popup._ef
-- Question mark, exclamation, quotes local _YY = ru_popup._YY
local _qe_ = ru_popup._qe_ local _yy = ru_popup._yy
local _VE = ru_popup._VE
local _ve = ru_popup._ve
local _AA = ru_popup._AA
local _aa = ru_popup._aa
local _PE = ru_popup._PE
local _pe = ru_popup._pe
local _ER = ru_popup._ER
local _er = ru_popup._er
local _OO = ru_popup._OO
local _oo = ru_popup._oo
local _EL = ru_popup._EL
local _el = ru_popup._el
local _DE = ru_popup._DE
local _de = ru_popup._de
local _JE = ru_popup._JE
local _je = ru_popup._je
local _EE = ru_popup._EE
local _ee = ru_popup._ee
-- Russian layout, bottom row of letters
local _YA = ru_popup._YA
local _ya = ru_popup._ya
local _CH = ru_popup._CH
local _ch = ru_popup._ch
local _ES = ru_popup._ES
local _es = ru_popup._es
local _EM = ru_popup._EM
local _em = ru_popup._em
local _II = ru_popup._II
local _ii = ru_popup._ii
local _TE = ru_popup._TE
local _te = ru_popup._te
local _SH = ru_popup._SH
local _sh = ru_popup._sh -- the Russian soft/hard sign
local _BE = ru_popup._BE
local _be = ru_popup._be
local _YU = ru_popup._YU
local _yu = ru_popup._yu
-- other
local _1_ = ru_popup._1_ -- numeric key 1
local _1p = ru_popup._1p -- numeric key 1, popup sibling (they have north swipe ups of each other, the rest is the same)
local _1n = ru_popup._1n -- numpad key 1
local _1s = ru_popup._1s -- superscript key 1
local _2_ = ru_popup._2_
local _2p = ru_popup._2p
local _2n = ru_popup._2n
local _2s = ru_popup._2s
local _3_ = ru_popup._3_
local _3p = ru_popup._3p
local _3n = ru_popup._3n
local _3s = ru_popup._3s
local _4_ = ru_popup._4_
local _4p = ru_popup._4p
local _4n = ru_popup._4n
local _4s = ru_popup._4s
local _5_ = ru_popup._5_
local _5p = ru_popup._5p
local _5n = ru_popup._5n
local _5s = ru_popup._5s
local _6_ = ru_popup._6_
local _6p = ru_popup._6p
local _6n = ru_popup._6n
local _6s = ru_popup._6s
local _7_ = ru_popup._7_
local _7p = ru_popup._7p
local _7n = ru_popup._7n
local _7s = ru_popup._7s
local _8_ = ru_popup._8_
local _8p = ru_popup._8p
local _8n = ru_popup._8n
local _8s = ru_popup._8s
local _9_ = ru_popup._9_
local _9p = ru_popup._9p
local _9n = ru_popup._9n
local _9s = ru_popup._9s
local _0_ = ru_popup._0_
local _0p = ru_popup._0p
local _0n = ru_popup._0n
local _0s = ru_popup._0s
local sla = ru_popup.sla
local sl2 = ru_popup.sl2
local eql = ru_popup.eql
local eq2 = ru_popup.eq2
local pls = ru_popup.pls
local pl2 = ru_popup.pl2
local mns = ru_popup.mns
local mn2 = ru_popup.mn2
local dsh = ru_popup.dsh
local dgr = ru_popup.dgr
local tpg = ru_popup.tpg
local mth = ru_popup.mth
local mt2 = ru_popup.mt2
local int = ru_popup.int
local dif = ru_popup.dif
local df2 = ru_popup.df2
local ls1 = ru_popup.ls1
local ls2 = ru_popup.ls2
local mr1 = ru_popup.mr1
local mr2 = ru_popup.mr2
local pdc = ru_popup.pdc
local pd2 = ru_popup.pd2
local bar = ru_popup.bar
local prm = ru_popup.prm
local hsh = ru_popup.hsh
local hs2 = ru_popup.hs2
return { return {
min_layer = 1, min_layer = 1,
max_layer = 8, max_layer = 4,
shiftmode_keys = {[""] = true, ["1/2"] = true, ["2/2"] = true}, shiftmode_keys = { [""] = true },
symbolmode_keys = {["123"] = true, ["АБВ"] = true, ["ещё"] = true}, symbolmode_keys = { [""] = true },
utf8mode_keys = {["🌐"] = true}, utf8mode_keys = { ["🌐"] = true },
umlautmode_keys = {["αβγ"] = true}, -- Width of any key can be modified by adding "width = 1.0, " in the list.
keys = { keys = {
-- first row -- First row
{ -- 1 2 3 4 5 6 7 8 { -- R r S s
{ "Й", "й", "'", "`", "", "", "", "`", }, { _1p, _1_, "`", "!", },
{ "Ц", "ц", "[", "1", "ς", "ς", "¹", "1", }, { _2p, _2_, "", "¡", },
{ _KU_, _ku_, "]", "2", "Ε", "ε", "²", "2", }, { _3p, _3_, "", dsh, },
{ _KK_, _kk_, "{", "3", "Ρ", "ρ", "³", "3", }, { _4p, _4_, "", "_", },
{ _Ye_, _ye_, "}", "4", "Τ", "τ", "", "4", }, { _5p, _5_, "", quo, },
{ _KN_, _kn_, "#", "5", "Υ", "υ", "", "5", }, { _6p, _6_, eq2, eql, },
{ _KG_, _kg_, "%", "6", "Θ", "θ", "", "6", }, { _7p, _7_, _7s, _7n, },
{ "Ш", "ш", "^", "7", "Ι", "ι", "", "7", }, { _8p, _8_, _8s, _8n, },
{ "Щ", "щ", "*", "8", "Ο", "ο", "", "8", }, { _9p, _9_, _9s, _9n, },
{ "З", "з", "+", "9", "Π", "π", "", "9", }, { _0p, _0_, sec, cse, },
{ _KH_, _kh_, _eq, "0", "²", "", "", "0", }, { sec, cse, "Ѣ", "ѣ", }, -- comma/semicolon with CSS popup block, plus Russian old letter yat (ять)
},
-- Second row
{ -- R r S s
{ _YK, _yk, dif, "?", },
{ _TS, _ts, int, "¿", },
{ _UU, _uu, mth, "~", },
{ _KK, _kk, mt2, "\\", },
{ _YE, _ye, df2, bar, },
{ _EN, _en, sl2, sla, },
{ _GG, _gg, _4s, _4n, },
{ _WA, _wa, _5s, _5n, },
{ _WE, _we, _6s, _6n, },
{ _ZE, _ze, mn2, mns, },
{ _HA, _ha, "Ѳ", "ѳ", }, -- Russian old letter fita (фита)
}, },
-- second row -- Third row
{ -- 1 2 3 4 5 6 7 8 { -- R r S s
{ "Ф", "ф", "_", "+", "Α", "α", "", "«", }, { _EF, _ef, ls2, ls1, },
{ _KI_, _ki_, "\\", "-", "Σ", "σ", "", "»", }, { _YY, _yy, mr2, mr1, },
{ "В", "в", "_", "/", "Δ", "δ", "", "", }, { _VE, _ve, dgr, "(", },
{ _KA_, _ka_, "~", ":", "Φ", "φ", "", "", }, { _AA, _aa, tpg, ")", },
{ "П", "п", "<", ";", "Γ", "γ", "", "", }, { _PE, _pe, hs2, hsh, },
{ "Р", "р", ">", "(", "Η", "η", "©", "", }, { _ER, _er, pd2, pdc, },
{ _KO_, _ko_, "", ")", "Ξ", "ξ", "", "", }, { _OO, _oo, _1s, _1n, },
{ "Л", "л", "£", "$", "Κ", "κ", "🄯", "", }, { _EL, _el, _2s, _2n, },
{ "Д", "д", "¥", "&", "Λ", "λ", "®", "§", }, { _DE, _de, _3s, _3n, },
{ _Je_, _je_, "", _at, "×", "×", "½", "¤", }, { _JE, _je, pl2, pls, },
{ "Э", "э", "¢", "", "", "", "¼", "", }, { _EE, _ee, "Ѵ", "ѵ", }, -- Russian old letter izhitsa (ижица)
}, },
-- third row -- Fourth row
{ -- 1 2 3 4 5 6 7 8 { -- R r S s
{ "", "", "2/2", "1/2", "", "", "", "", { label = "", width = 1.0, }, -- Shift
width = 1.0 { _YA, _ya, prm, "{", },
}, { _CH, _ch, "°", "}", },
{ "Я", "я", "", "", "Ζ", "ζ", "", "±", }, { _ES, _es, "«", "«", },
{ "Ч", "ч", "", "", "Χ", "χ", "", "º", }, { _EM, _em, "»", "»", },
{ "С", "с", com, com, "Ψ", "ψ", "", "", }, { _II, _ii, "", "[", },
{ "М", "м", prd, prd, "Ω", "ω", "", "", }, { _TE, _te, "", "]", },
{ "И", "и", "?", "?", "Β", "β", "", "¿", }, { _SH, _sh, _0s, _0n, },
{ "Т", "т", "!", "!", "Ν", "ν", "", "¡", }, { _BE, _be, "", "", },
{ _SH_, _sh_, "", "", "Μ", "μ", "", "", }, { _YU, _yu, "", "", },
{ "Б", "б", "", "", "", "", "", "", }, { label = "", width = 1.0, }, -- Backspace
{ "Ю", "ю", "|", "|", "", "", "|", "|", },
{ label = "",
width = 1.0,
bold = false
},
}, },
-- fourth row -- Fifth row
{ -- 1 2 3 4 5 6 7 8 { -- R r S s
{ "123", "123", "АБВ", "АБВ", "ещё", "ещё", "ещё", "ещё", { label = "", width = 1.5, bold = true, }, -- SYM key
width = 1.0}, { label = "🌐", }, -- Globe key
{ label = "🌐", }, { cop, pco, cop, pco, }, -- period/colon with RegEx popup block
{ "αβγ", "αβγ", "αβγ", "αβγ", "αβγ", "αβγ", "αβγ", "αβγ", }, { label = "_", " ", " ", " ", " ", width = 4.0, }, -- Spacebar
{ label = "пробел", { label = "", }, -- Arrow left
" ", " ", " ", " ", " ", " ", " ", " ", { label = "", }, -- Arrow right
width = 4.0}, { label = "", "\n","\n","\n","\n", width = 1.5, }, -- Enter
{ _qe_, _qe_, "", "", _qe_, _qe_, "", "", },
{ com, com, "", "", com, com, "", "", }, -- arrow down
{ prd, prd, "", "", prd, prd, "", "", },
{ label = "",
"\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n",
width = 1.0,
bold = true
},
}, },
}, },
} }

@ -2,70 +2,89 @@
local tr_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/en_keyboard")) local tr_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/en_keyboard"))
local keys = tr_keyboard.keys local keys = tr_keyboard.keys
-- Insert 2 additional key at the end of first 3 rows after numeric row.
-- Kurdish and Azerbaijani letters are on SYM layer (3 and 4).
-- Insert 2 additional key at the end of first 3 rows. -- Turkish Lira currency
-- 5th and 6th modes are from Kurdish and Azerbaijani alphabets.
-- Add Ğ, G with breve
table.insert(keys[1], table.insert(keys[1],
-- 1 2 3 4 5 6 7 8 { "", "", "", "", }
{ "Ğ", "ğ", "«", "μ", "Ź", "ź", "γ", "σ", }
) )
-- empty key to make extra keys on other rows fit
-- Add Ü, U with umlaut
table.insert(keys[1], table.insert(keys[1],
-- 1 2 3 4 5 6 7 8 { "", "", "", "", }
{ "Ü", "ü", "»", "β", "Ə", "ə", "δ", "ψ", }
) )
-- Add Ğ, G with breve
-- Add Ş, S with cedilla
table.insert(keys[2], table.insert(keys[2],
-- 1 2 3 4 5 6 7 8 { { "Ğ", north = "ğ", }, { "ğ", north = "Ğ", }, { "Ź", north = "ź", }, { "ź", north = "Ź", }, }
{ "Ş", "ş", "`", "α", "", "", "ε", "χ", }
) )
-- Add Ü, U with umlaut
-- Add İ and i, dotted I and i
table.insert(keys[2], table.insert(keys[2],
-- 1 2 3 4 5 6 7 8 { { "Ü", north = "ü", }, { "ü", north = "Ü", }, { "Ə", north = "ə", }, { "ə", north = "Ə", }, }
{ "İ", "i", "", "θ", "", "", "η", "τ", } )
-- Add Ş, S with cedilla
table.insert(keys[3], 10,
{ { "Ş", north = "ş", }, { "ş", north = "Ş", }, { "", north = "", }, { "", north = "", }, }
)
-- Add İ and i, dotted I and i
table.insert(keys[3], 11,
{ { "İ", north = "i", }, { "i", north = "İ", }, { "", north = "", }, { "", north = "", }, }
) )
-- Add Ö, O with umlaut -- Add Ö, O with umlaut
table.insert(keys[3], 9, table.insert(keys[4], 9,
-- 1 2 3 4 5 6 7 8 { { "Ö", north = "ö", }, { "ö", north = "Ö", }, { "Ł", north = "ł", }, { "ł", north = "Ł", }, }
{ "Ö", "ö", "²", "π", "Ł", "ł", "ι", "ρ", }
) )
-- Add Ç, C with cedilla -- Add Ç, C with cedilla
table.insert(keys[3], 10, table.insert(keys[4], 10,
-- 1 2 3 4 5 6 7 8 { { "Ç", north = "ç", }, { "ç", north = "Ç", }, { "Ř", north = "ř", }, { "ř", north = "Ř", }, }
{ "Ç", "ç", "", "ω", "Ř", "ř", "ν", "κ", }
) )
-- change order "ḧ ẍ ," to ", ḧ ẍ"
keys[3][10][3], keys[3][11][3], keys[3][12][3] = keys[3][12][3], keys[3][10][3], keys[3][11][3]
keys[3][10][4], keys[3][11][4], keys[3][12][4] = keys[3][12][4], keys[3][10][4], keys[3][11][4]
-- Add forward slash and .com symbol to 4th row since we have lot of empty space -- Add forward slash and .com symbol to 4th row since we have lot of empty space
--and most phones do this. --and most phones do this.
table.insert(keys[4], 7, table.insert(keys[5], 7,
-- 1 2 3 4 5 6 7 8 { ".com", "/", "\"", "\"", }
{ ".com", "/", "", "λ", "\"", "\"", "ζ", "ξ", }
) )
-- Make .com and Unicode buttons larger since we still have space. -- Make .com and Unicode buttons larger since we still have space.
keys[4][3].width = 1.5 --
keys[4][7].width = 1.5 keys[5][3].width = 1.5
keys[5][7].width = 1.5
-- Change lowercase "i" to "ı" -- Change lowercase "i" to dotless "ı"
keys[1][8][2] = "ı" keys[2][8][2] = {
"ı", -- dotless i (Turkish)
north = "I", -- dotless I (Turkish)
northeast = "í",
northwest = "ì",
east = "î",
west = "ĩ",
south = "į",
southeast = "ï",
southwest = "ɪ",
"ī",
"ι", -- Greek iota
"i", -- latin i
}
-- Translate the "space" string keys[2][8][1] = {
keys[4][4].label = "boşluk" "I", -- dotless I
north = "ı", -- dotless i (Turkish)
northeast = "Í",
northwest = "Ì",
east = "Î",
west = "Ĩ",
south = "Į",
southeast = "Ï",
southwest = "ɪ",
"Ī",
"Ι", -- Greek iota
"I",
}
--Or remove / and move Ü to 3rd row. -- Translate the "space" string
--keys[4][7] = keys[3][11] keys[5][4].label = "boşluk"
--keys[3][11] = keys[1][12]
--table.remove(keys[1], 12)
--Shrink Backspace, Shift, Sym, Unicode buttons to normal.
--keys[3][1].width = 1
--keys[3][11].width = 1
--keys[4][1].width = 1
--keys[4][3].width = 1
return tr_keyboard return tr_keyboard

@ -328,7 +328,7 @@ end
if Device:isTouchDevice() then if Device:isTouchDevice() then
common_settings.keyboard_layout = { common_settings.keyboard_layout = {
text = _("Keyboard layout"), text = _("Keyboard"),
sub_item_table = require("ui/elements/menu_keyboard_layout"), sub_item_table = require("ui/elements/menu_keyboard_layout"),
} }
common_settings.taps_and_gestures = { common_settings.taps_and_gestures = {

@ -1,11 +1,105 @@
local CheckButton = require("ui/widget/checkbutton")
local FFIUtil = require("ffi/util") local FFIUtil = require("ffi/util")
local HorizontalGroup = require("ui/widget/horizontalgroup")
local HorizontalSpan = require("ui/widget/horizontalspan")
local Language = require("ui/language") local Language = require("ui/language")
local UIManager = require("ui/uimanager")
local VerticalGroup = require("ui/widget/verticalgroup")
local VirtualKeyboard = require("ui/widget/virtualkeyboard") local VirtualKeyboard = require("ui/widget/virtualkeyboard")
local _ = require("gettext")
local sub_item_table = {} local input_dialog, check_button_bold, check_button_border
local sub_item_table = {
{
text = _("Keyboard layout"),
sub_item_table = {},
},
{
text = _("Keyboard font size"),
keep_menu_open = true,
callback = function()
input_dialog = require("ui/widget/inputdialog"):new{
title = _("Keyboard font size"),
input = tostring(G_reader_settings:readSetting("keyboard_key_font_size") or 22),
input_hint = "(16 - 30)",
buttons = {
{
{
text = _("Close"),
callback = function()
UIManager:close(input_dialog)
end,
},
{
text = _("Apply"),
is_enter_default = true,
callback = function()
local font_size = tonumber(input_dialog:getInputText())
if font_size and font_size >= 16 and font_size <= 30 then
G_reader_settings:saveSetting("keyboard_key_font_size", font_size)
G_reader_settings:saveSetting("keyboard_key_bold", check_button_bold.checked)
G_reader_settings:saveSetting("keyboard_key_border", check_button_border.checked)
input_dialog._input_widget:onCloseKeyboard()
input_dialog._input_widget:initKeyboard()
input_dialog:onShowKeyboard()
end
end,
},
},
},
}
-- checkboxes
check_button_bold = CheckButton:new{
text = _("in bold"),
checked = G_reader_settings:isTrue("keyboard_key_bold"),
parent = input_dialog,
max_width = input_dialog._input_widget.width,
callback = function()
if check_button_bold.checked then
check_button_bold:unCheck()
else
check_button_bold:check()
end
end,
}
check_button_border = CheckButton:new{
text = _("with border"),
checked = G_reader_settings:nilOrTrue("keyboard_key_border"),
parent = input_dialog,
max_width = input_dialog._input_widget.width,
callback = function()
if check_button_border.checked then
check_button_border:unCheck()
else
check_button_border:check()
end
end,
}
local checkbox_shift = math.floor((input_dialog.width - input_dialog._input_widget.width) / 2 + 0.5)
local check_buttons = HorizontalGroup:new{
HorizontalSpan:new{width = checkbox_shift},
VerticalGroup:new{
align = "left",
check_button_bold,
check_button_border,
},
}
-- insert check buttons before the regular buttons
local nb_elements = #input_dialog.dialog_frame[1]
table.insert(input_dialog.dialog_frame[1], nb_elements-1, check_buttons)
UIManager:show(input_dialog)
input_dialog:onShowKeyboard()
end,
},
}
for k, _ in FFIUtil.orderedPairs(VirtualKeyboard.lang_to_keyboard_layout) do for k, _ in FFIUtil.orderedPairs(VirtualKeyboard.lang_to_keyboard_layout) do
table.insert(sub_item_table, { table.insert(sub_item_table[1].sub_item_table, {
text_func = function() text_func = function()
local text = Language:getLanguageName(k) local text = Language:getLanguageName(k)
if VirtualKeyboard:getKeyboardLayout() == k then if VirtualKeyboard:getKeyboardLayout() == k then

@ -39,7 +39,7 @@ local Language = {
ja = "日本語", ja = "日本語",
kk = "Қазақ", kk = "Қазақ",
ko_KR = "한글", ko_KR = "한글",
ru = "Русский язык", ru = "Русский",
uk = "Українська", uk = "Українська",
zh = "中文", zh = "中文",
zh_CN = "简体中文", zh_CN = "简体中文",

@ -41,13 +41,16 @@ local VirtualKey = InputContainer:new{
width = nil, width = nil,
height = math.max(Screen:getWidth(), Screen:getHeight())*0.33, height = math.max(Screen:getWidth(), Screen:getHeight())*0.33,
bordersize = Size.border.thin, bordersize = 0,
focused_bordersize = Size.border.default * 5, focused_bordersize = Size.border.default,
radius = 0, radius = 0,
face = Font:getFace("infont"), face = Font:getFace("infont"),
} }
function VirtualKey:init() function VirtualKey:init()
local label_font_size = G_reader_settings:readSetting("keyboard_key_font_size") or 22
self.face = Font:getFace("infont", label_font_size)
self.bold = G_reader_settings:isTrue("keyboard_key_bold")
if self.keyboard.symbolmode_keys[self.label] ~= nil then if self.keyboard.symbolmode_keys[self.label] ~= nil then
self.callback = function () self.keyboard:setLayer("Sym") end self.callback = function () self.keyboard:setLayer("Sym") end
self.skiptap = true self.skiptap = true
@ -83,7 +86,7 @@ function VirtualKey:init()
end end
end end
self.hold_callback = function() self.hold_callback = function()
if util.tableSize(self.key_chars) > 3 then if util.tableSize(self.key_chars) > 5 then
self.popup = VirtualKeyPopup:new{ self.popup = VirtualKeyPopup:new{
parent_key = self, parent_key = self,
} }
@ -137,7 +140,7 @@ function VirtualKey:init()
} }
end end
self.swipe_callback = function(ges) self.swipe_callback = function(ges)
local key_string = self.key_chars[ges.direction] local key_string = self.key_chars[ges.direction] or self.key
local key_function = self.key_chars[ges.direction.."_func"] local key_function = self.key_chars[ges.direction.."_func"]
if not key_function and key_string then if not key_function and key_string then
@ -168,6 +171,47 @@ function VirtualKey:init()
face = self.face, face = self.face,
bold = self.bold or false, bold = self.bold or false,
} }
-- Make long labels fit by decreasing font size
local max_width = self.width - 2*self.bordersize - 2*Size.padding.small
while label_widget:getWidth() > max_width do
local new_size = label_widget.face.orig_size - 1
label_widget:free()
if new_size < 8 then break end -- don't go too small
label_widget = TextWidget:new{
text = self.label,
face = Font:getFace(self.face.orig_font, new_size),
bold = self.bold or false,
}
end
end
if self.alt_label then
local OverlapGroup = require("ui/widget/overlapgroup")
local alt_label_widget = TextWidget:new{
text = self.alt_label,
face = Font:getFace(self.face.orig_font, label_font_size - 4),
bold = self.bold or false,
fgcolor = Blitbuffer.COLOR_DARK_GRAY,
padding = 0, -- no additional padding to font line height
}
local key_inner_dimen = Geom:new{
w = self.width - 2*self.bordersize - 2*Size.padding.default,
h = self.height - 2*self.bordersize - 2*Size.padding.small, -- already some padding via line height
}
label_widget = OverlapGroup:new{
CenterContainer:new{
dimen = key_inner_dimen,
label_widget,
},
WidgetContainer:new{
overlap_align = "right",
dimen = Geom:new{
w = alt_label_widget:getSize().w,
h = key_inner_dimen.h,
},
alt_label_widget,
},
}
end end
self[1] = FrameContainer:new{ self[1] = FrameContainer:new{
margin = 0, margin = 0,
@ -224,7 +268,7 @@ function VirtualKey:init()
} }
end end
if (self.keyboard.shiftmode_keys[self.label] ~= nil and self.keyboard.shiftmode) or if (self.keyboard.shiftmode_keys[self.label] ~= nil and self.keyboard.shiftmode) or
(self.keyboard.umlautmode_keys[self.label] ~= nil and self.keyboard.umlautmode) then (self.keyboard.symbolmode_keys[self.label] ~= nil and self.keyboard.symbolmode) then
self[1].background = Blitbuffer.COLOR_LIGHT_GRAY self[1].background = Blitbuffer.COLOR_LIGHT_GRAY
end end
self.flash_keyboard = G_reader_settings:nilOrTrue("flash_keyboard") self.flash_keyboard = G_reader_settings:nilOrTrue("flash_keyboard")
@ -241,8 +285,9 @@ function VirtualKey:genkeyboardLayoutKeyChars()
local key_chars = { local key_chars = {
{ label = "🌐", { label = "🌐",
}, },
east = { label = "🌐", }, east = { label = "", },
east_func = function () east_func = function ()
UIManager:close(self.popup)
self.keyboard_layout_dialog = KeyboardLayoutDialog:new{ self.keyboard_layout_dialog = KeyboardLayoutDialog:new{
parent = self, parent = self,
} }
@ -586,14 +631,14 @@ function VirtualKeyPopup:init()
local keyboard_frame = FrameContainer:new{ local keyboard_frame = FrameContainer:new{
margin = 0, margin = 0,
bordersize = Size.border.default, bordersize = Size.border.default,
background = Blitbuffer.COLOR_WHITE, background = G_reader_settings:nilOrTrue("keyboard_key_border") and Blitbuffer.COLOR_LIGHT_GRAY or Blitbuffer.COLOR_WHITE,
radius = 0, radius = 0,
padding = parent_key.keyboard.padding, padding = parent_key.keyboard.padding,
allow_mirroring = false, allow_mirroring = false,
CenterContainer:new{ CenterContainer:new{
dimen = Geom:new{ dimen = Geom:new{
w = parent_key.width*num_columns + 2*Size.border.default + (num_columns)*parent_key.keyboard.key_padding, w = parent_key.width*num_columns + 2*Size.border.default + (num_columns+1)*parent_key.keyboard.key_padding,
h = parent_key.height*num_rows + 2*Size.border.default + num_rows*parent_key.keyboard.key_padding, h = parent_key.height*num_rows + 2*Size.border.default + (num_rows+1)*parent_key.keyboard.key_padding,
}, },
vertical_group, vertical_group,
} }
@ -617,17 +662,17 @@ function VirtualKeyPopup:init()
self.key_events.Close = { {"Back"}, doc = "close keyboard" } self.key_events.Close = { {"Back"}, doc = "close keyboard" }
end end
local offset_x = 2*parent_key.keyboard.padding + 2*parent_key.keyboard.bordersize local offset_x = 2*keyboard_frame.bordersize + keyboard_frame.padding + parent_key.keyboard.key_padding
if columns[1] then if columns[1] then
offset_x = offset_x + parent_key.width + parent_key.keyboard.padding + 2*parent_key.keyboard.bordersize offset_x = offset_x + parent_key.width + parent_key.keyboard.key_padding
end end
local offset_y = parent_key.keyboard.padding + parent_key.keyboard.padding + 2*parent_key.keyboard.bordersize local offset_y = 2*keyboard_frame.bordersize + keyboard_frame.padding + parent_key.keyboard.key_padding
if rows.extra_key_chars then if rows.extra_key_chars then
offset_y = offset_y + parent_key.height + parent_key.keyboard.padding + 2*parent_key.keyboard.bordersize offset_y = offset_y + parent_key.height + parent_key.keyboard.key_padding
end end
if rows.top_key_chars then if rows.top_key_chars then
offset_y = offset_y + parent_key.height + parent_key.keyboard.padding + 2*parent_key.keyboard.bordersize offset_y = offset_y + parent_key.height + parent_key.keyboard.key_padding
end end
local position_container = WidgetContainer:new{ local position_container = WidgetContainer:new{
@ -684,8 +729,8 @@ local VirtualKeyboard = FocusManager:new{
width = Screen:scaleBySize(600), width = Screen:scaleBySize(600),
height = nil, height = nil,
bordersize = Size.border.default, bordersize = Size.border.default,
padding = Size.padding.small, padding = 0,
key_padding = Size.padding.default, key_padding = Size.padding.small,
lang_to_keyboard_layout = { lang_to_keyboard_layout = {
ar_AA = "ar_AA_keyboard", ar_AA = "ar_AA_keyboard",
@ -828,14 +873,18 @@ function VirtualKeyboard:addKeys()
local key local key
local key_chars = self.KEYS[i][j][self.keyboard_layer] local key_chars = self.KEYS[i][j][self.keyboard_layer]
local label local label
local alt_label
local width_factor
if type(key_chars) == "table" then if type(key_chars) == "table" then
key = key_chars[1] key = key_chars[1]
label = key_chars.label label = key_chars.label
alt_label = key_chars.alt_label
width_factor = key_chars.width
else else
key = key_chars key = key_chars
key_chars = nil key_chars = nil
end end
local width_factor = self.KEYS[i][j].width or 1.0 width_factor = width_factor or self.KEYS[i][j].width or self.KEYS[i].width or 1.0
local key_width = math.floor((base_key_width + self.key_padding) * width_factor) local key_width = math.floor((base_key_width + self.key_padding) * width_factor)
- self.key_padding - self.key_padding
local key_height = base_key_height local key_height = base_key_height
@ -845,6 +894,7 @@ function VirtualKeyboard:addKeys()
key_chars = key_chars, key_chars = key_chars,
icon = self.KEYS[i][j].icon, icon = self.KEYS[i][j].icon,
label = label, label = label,
alt_label = alt_label,
bold = self.KEYS[i][j].bold, bold = self.KEYS[i][j].bold,
keyboard = self, keyboard = self,
width = key_width, width = key_width,
@ -869,7 +919,7 @@ function VirtualKeyboard:addKeys()
local keyboard_frame = FrameContainer:new{ local keyboard_frame = FrameContainer:new{
margin = 0, margin = 0,
bordersize = Size.border.default, bordersize = Size.border.default,
background = Blitbuffer.COLOR_WHITE, background = G_reader_settings:nilOrTrue("keyboard_key_border") and Blitbuffer.COLOR_LIGHT_GRAY or Blitbuffer.COLOR_WHITE,
radius = 0, radius = 0,
padding = self.padding, padding = self.padding,
allow_mirroring = false, allow_mirroring = false,
@ -897,7 +947,7 @@ function VirtualKeyboard:setLayer(key)
self.umlautmode = not self.umlautmode self.umlautmode = not self.umlautmode
end end
self:initLayer() self:initLayer()
self:_refresh(true) self:_refresh(false)
end end
function VirtualKeyboard:addChar(key) function VirtualKeyboard:addChar(key)

Loading…
Cancel
Save