mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Virtual keyboard: add Scandinavian layouts (Norwegian, Swedish & Danish) (#11365)
This commit is contained in:
10
frontend/ui/data/keyboardlayouts/da_keyboard.lua
Normal file
10
frontend/ui/data/keyboardlayouts/da_keyboard.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
-- Start with the norwegian keyboard layout (deep copy, to not alter it)
|
||||
local da_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/no_keyboard"))
|
||||
|
||||
local keys = da_keyboard.keys
|
||||
|
||||
-- swap "Ø" and "Æ", and "ø" and "æ"
|
||||
keys[3][10][1], keys[3][11][1] = keys[3][11][1], keys[3][10][1]
|
||||
keys[3][10][2], keys[3][11][2] = keys[3][11][2], keys[3][10][2]
|
||||
|
||||
return da_keyboard
|
||||
81
frontend/ui/data/keyboardlayouts/no_keyboard.lua
Normal file
81
frontend/ui/data/keyboardlayouts/no_keyboard.lua
Normal file
@@ -0,0 +1,81 @@
|
||||
-- Start with the english keyboard layout (deep copy, to not alter it)
|
||||
local no_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/en_keyboard"))
|
||||
|
||||
local keys = no_keyboard.keys
|
||||
|
||||
-- add ' key next to numeric 0
|
||||
table.insert(
|
||||
keys[1],
|
||||
{
|
||||
{ "*", alt_label = "'", north = "'", },
|
||||
{ "'", alt_label = "*", north = "*", },
|
||||
{ "/", alt_label = "÷", north = "÷", },
|
||||
{ "÷", alt_label = "/", north = "/", },
|
||||
}
|
||||
)
|
||||
|
||||
-- add Å key
|
||||
table.insert(
|
||||
keys[2],
|
||||
{
|
||||
{ "Å", north = "å", },
|
||||
{ "å", north = "Å", },
|
||||
{ "*", alt_label = "×", north = "×", },
|
||||
{ "×", alt_label = "*", north = "*", },
|
||||
}
|
||||
)
|
||||
|
||||
-- add Æ key
|
||||
table.insert(
|
||||
keys[3],
|
||||
{
|
||||
{ "Æ", north = "æ", },
|
||||
{ "æ", north = "Æ", },
|
||||
{ "✗", north = "✘", west = "☐", south = "☒", },
|
||||
{
|
||||
"⭤",
|
||||
north = "⭡",
|
||||
northeast = "⭧",
|
||||
northwest = "⭦",
|
||||
east = "⭢",
|
||||
west = "⭠",
|
||||
south = "⭣",
|
||||
southeast = "⭨",
|
||||
southwest = "⭩",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
-- add Ø key
|
||||
table.insert(
|
||||
keys[4],
|
||||
7,
|
||||
{
|
||||
{ "Ø", north = "ø", },
|
||||
{ "ø", north = "Ø", },
|
||||
{ "✓", north = "✔", west = "☐", south = "☑", },
|
||||
{ "•", alt_label = "◦", north = "◦", northwest = "⁃", west = "‣", },
|
||||
}
|
||||
)
|
||||
|
||||
-- swap "Ø" and ";" / "ø" 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]
|
||||
|
||||
-- swap ";" and "✓" / "," and "•"
|
||||
keys[4][7][3], keys[3][10][3] = keys[3][10][3], keys[4][7][3]
|
||||
keys[4][7][4], keys[3][10][4] = keys[3][10][4], keys[4][7][4]
|
||||
|
||||
-- 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" and resize buttons
|
||||
keys[5][4].label = "␣" -- label the Spacebar with Unicode space symbol
|
||||
keys[4][1].width = 1.5 -- resize Shift
|
||||
keys[4][10].width = 1.5 -- resize Backspace
|
||||
keys[5][4].width = 4 -- resize Spacebar
|
||||
keys[5][1].width = 1.5 -- resize Symbols
|
||||
keys[5][7].width = 1.5 -- resize Enter
|
||||
|
||||
return no_keyboard
|
||||
14
frontend/ui/data/keyboardlayouts/sv_keyboard.lua
Normal file
14
frontend/ui/data/keyboardlayouts/sv_keyboard.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
-- Start with the norwegian keyboard layout (deep copy, to not alter it)
|
||||
local sv_keyboard = require("util").tableDeepCopy(require("ui/data/keyboardlayouts/no_keyboard"))
|
||||
|
||||
local keys = sv_keyboard.keys
|
||||
|
||||
-- replace "Ø" and "ø" with "Ö" and "ö"
|
||||
keys[3][10][1] = { "Ö", north = "ö", }
|
||||
keys[3][10][2] = { "ö", north = "Ö", }
|
||||
|
||||
-- replace "Æ" and "æ" with "Ä" and "ä"
|
||||
keys[3][11][1] = { "Ä", north = "ä", }
|
||||
keys[3][11][2] = { "ä", north = "Ä", }
|
||||
|
||||
return sv_keyboard
|
||||
@@ -8,6 +8,7 @@ local Language = {
|
||||
en = "English",
|
||||
ca = "Catalá",
|
||||
cs = "Čeština",
|
||||
da = "Dansk",
|
||||
de = "Deutsch",
|
||||
eo = "Esperanto",
|
||||
es = "Español",
|
||||
@@ -22,7 +23,7 @@ local Language = {
|
||||
lt_LT = "Lietuvių",
|
||||
lv = "Latviešu",
|
||||
nl_NL = "Nederlands",
|
||||
nb_NO = "Norsk",
|
||||
nb_NO = "Norsk bokmål",
|
||||
pl = "Polski",
|
||||
pl_PL = "Polski2",
|
||||
pt_PT = "Português",
|
||||
|
||||
@@ -799,6 +799,7 @@ local VirtualKeyboard = FocusManager:extend{
|
||||
ar = "ar_keyboard",
|
||||
bg_BG = "bg_keyboard",
|
||||
bn = "bn_keyboard",
|
||||
da = "da_keyboard",
|
||||
de = "de_keyboard",
|
||||
el = "el_keyboard",
|
||||
en = "en_keyboard",
|
||||
@@ -809,11 +810,13 @@ local VirtualKeyboard = FocusManager:extend{
|
||||
ja = "ja_keyboard",
|
||||
ka = "ka_keyboard",
|
||||
ko_KR = "ko_KR_keyboard",
|
||||
nb_NO = "no_keyboard",
|
||||
pl = "pl_keyboard",
|
||||
pt_BR = "pt_keyboard",
|
||||
ro = "ro_keyboard",
|
||||
ru = "ru_keyboard",
|
||||
sk = "sk_keyboard",
|
||||
sv = "sv_keyboard",
|
||||
th = "th_keyboard",
|
||||
tr = "tr_keyboard",
|
||||
uk = "uk_keyboard",
|
||||
|
||||
Reference in New Issue
Block a user