2
0
mirror of https://github.com/koreader/koreader synced 2024-11-13 19:11:25 +00:00
koreader/frontend/ui/elements/menu_keyboard_layout.lua
Frans de Jonge 17e437dbd0
[UX] Allow keyboard layout selection (#5318)
Fixes <https://github.com/koreader/koreader/issues/3998>.

This isn't quite what I want but I've been letting this slip for
too long due to fancier keyboard interaction concepts.
2019-09-06 17:01:37 +02:00

20 lines
579 B
Lua

local Language = require("ui/language")
local VirtualKeyboard = require("ui/widget/virtualkeyboard")
local orderedPairs = require("ffi/util").orderedPairs
local sub_item_table = {}
for k, _ in orderedPairs(VirtualKeyboard.lang_to_keyboard_layout) do
table.insert(sub_item_table, {
text = Language:getLanguageName(k),
checked_func = function()
return VirtualKeyboard:getKeyboardLayout() == k
end,
callback = function()
G_reader_settings:saveSetting("keyboard_layout", k)
end,
})
end
return sub_item_table