[feat] Add Thai keyboard (#9620)

This PR adds support for a Thai keyboard. Layout mostly copied from my phone, with difference in diacritics placements: phone has only one key for all of them, while here we have a couple more. Swipe in different directions needed for inputing them.
reviewable/pr9628/r1
weijiuqiao 2 years ago committed by GitHub
parent a728e3b5fa
commit 8508689cea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,106 @@
-- Start with the english keyboard layout (deep copy, to not alter it)
local th_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/en_keyboard"))
-- Swap the four AZWQ keys (only in the lowercase and
-- uppercase letters layouts) to change it from QWERTY to AZERTY
local keys = th_keyboard.keys
keys[1][7][3] = ""
keys[1][8][3] = ""
keys[1][9][3] = ""
table.insert(keys[1], {
{"", north="", alt_label=""},
{"", north="", alt_label="", south="",},
"", ""
})
keys[2][1][1] = { "", north="", alt_label="" }
keys[2][1][2] = { "", north="", alt_label="" }
keys[2][2][1] = { "", north="", alt_label="" }
keys[2][2][2] = { "", north="", alt_label="" }
keys[2][3][1] = { "", north="", alt_label="" }
keys[2][3][2] = { "", north="", alt_label="" }
keys[2][4][1] = { "", north="", alt_label="" }
keys[2][4][2] = { "", north="", alt_label="" }
keys[2][5][1] = { "", north="", alt_label="" }
keys[2][5][2] = { "", north="", alt_label="" }
keys[2][6][1] = { "", north="", alt_label="" }
keys[2][6][2] = { "", north="", alt_label="" }
keys[2][7][1] = { "", north="", alt_label="" }
keys[2][7][2] = { "", north="", alt_label="" }
keys[2][7][3] = ""
keys[2][8][1] = { "", north="", alt_label="" }
keys[2][8][2] = { "", north="", alt_label="" }
keys[2][8][3] = ""
keys[2][9][1] = { "", north="", alt_label="" }
keys[2][9][2] = { "", north="", alt_label="" }
keys[2][9][3] = ""
keys[2][10][1] = { "", north="", alt_label="" }
keys[2][10][2] = { "", north="", alt_label="" }
table.insert(keys[2],{
{"", north="", alt_label=""},
{"", north="", alt_label=""},
"฿","฿"
})
keys[3][1][1] = { "", north="", alt_label="" }
keys[3][1][2] = { "", north="", alt_label="" }
keys[3][2][1] = { "", north="", alt_label="" }
keys[3][2][2] = { "", north="", alt_label="" }
keys[3][3][1] = { "", north="", alt_label="" }
keys[3][3][2] = { "", north="", alt_label="" }
keys[3][4][1] = { "", north="", alt_label="" }
keys[3][4][2] = { "", north="", alt_label="" }
keys[3][5][1] = { "", north="", alt_label="" }
keys[3][5][2] = { "", north="", alt_label="" }
keys[3][6][1] = { "", north="", alt_label="" }
keys[3][6][2] = { "", north="", alt_label="" }
keys[3][7][1] = { "", north="", alt_label="" }
keys[3][7][2] = { "", north="", alt_label="" }
keys[3][7][3] = ""
keys[3][8][1] = { "", north="", alt_label="" }
keys[3][8][2] = { "", north="", alt_label="" }
keys[3][8][3] = ""
keys[3][9][1] = { "", north="", alt_label="" }
keys[3][9][2] = { "", north="", alt_label="" }
keys[3][9][3] = ""
keys[3][10][1] = { "", north="", alt_label="" }
keys[3][10][2] = { "", north="", alt_label="" }
table.insert(keys[3],{
{"", north="", alt_label=""},
{"", north="", alt_label="", south="", west=""},
"",""
})
keys[4][2][1] = { "", north="", alt_label="" }
keys[4][2][2] = { "", north="", alt_label="" }
keys[4][3][1] = { "", north="", alt_label="" }
keys[4][3][2] = { "", north="", alt_label="" }
keys[4][4][1] = { "", north="", alt_label="" }
keys[4][4][2] = { "", north="", alt_label="" }
keys[4][5][1] = { "", north="", alt_label="" }
keys[4][5][2] = { "", north="", alt_label="" }
keys[4][6][1] = { "", north="", alt_label="" }
keys[4][6][2] = { "", north="", alt_label="" }
keys[4][6][3] = ""
keys[4][7][1] = { "", north="", alt_label="" }
keys[4][7][2] = { "", north="", alt_label="" }
keys[4][8][1] = { "", north="", alt_label="" }
keys[4][8][2] = { "", north="", alt_label="" }
table.insert(keys[4], 9, {
{"", north="", alt_label=""},
{"", north="", alt_label="", south="", west="", east=""},
"",""
})
table.insert(keys[5],7, {
{"", north="", alt_label=""},
{"", north="", alt_label=""},
"/","/"
})
-- Remove the "space" string
keys[5][4].label = ""
return th_keyboard

@ -31,6 +31,7 @@ local Language = {
ro_MD = "Română (Moldova)",
sk = "Slovenčina",
sv = "Svenska",
th = "ภาษาไทย",
vi = "Tiếng Việt",
tr = "Türkçe",
vi_VN = "Viet Nam",

@ -767,6 +767,7 @@ local VirtualKeyboard = FocusManager:extend{
ro = "ro_keyboard",
ko_KR = "ko_KR_keyboard",
ru = "ru_keyboard",
th = "th_keyboard",
tr = "tr_keyboard",
zh = "zh_keyboard",
},

Loading…
Cancel
Save