2
0
mirror of https://github.com/koreader/koreader synced 2024-11-18 03:25:46 +00:00
koreader/frontend/ui/data/keyboardlayouts/th_keyboard.lua
weijiuqiao 8508689cea
[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.
2022-10-12 11:25:43 +02:00

107 lines
4.3 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 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