Skip to content

Commit

Permalink
keyboard: japanese: always put digits as the south gesture for latin (#…
Browse files Browse the repository at this point in the history
…8443)

This is to match GBoard's layout for the latin keyboard mode.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
  • Loading branch information
cyphar committed Nov 14, 2021
1 parent 26ec5ba commit 7e611ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
12 changes: 6 additions & 6 deletions frontend/ui/data/keyboardlayouts/ja_keyboard_keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ return {
l_1 = { label = "@-_/", alt_label = "",
"@", west = "-", north = "_", east = "/", south = "" },
l_2 = { label = "abc", alt_label = "",
"a", west = "b", north = "c", east = "" },
"a", west = "b", north = "c", south = "" },
l_3 = { label = "def", alt_label = "",
"d", west = "e", north = "f", east = "" },
"d", west = "e", north = "f", south = "" },
l_4 = { label = "ghi", alt_label = "",
"g", west = "h", north = "i", east = "" },
"g", west = "h", north = "i", south = "" },
l_5 = { label = "jkl", alt_label = "",
"j", west = "k", north = "l", east = "" },
"j", west = "k", north = "l", south = "" },
l_6 = { label = "mno", alt_label = "",
"m", west = "n", north = "o", east = "" },
"m", west = "n", north = "o", south = "" },
l_7 = { label = "pqrs", alt_label = "",
"p", west = "q", north = "r", east = "s", south = "" },
l_8 = { label = "tuv", alt_label = "",
"t", west = "u", north = "v", east = "" },
"t", west = "u", north = "v", south = "" },
l_9 = { label = "wxyz", alt_label = "",
"w", west = "x", north = "y", east = "z", south = "" },
l_0 = { label = "'\":;", alt_label = "",
Expand Down
21 changes: 11 additions & 10 deletions tools/ja_keyboard_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ def render_key(self, indent_level=1):
if lua_items:
lua_items.append("\n") # Put the labels on a separate line.
for direction, key in zip(["", "west", "north", "east", "south"], self.popout):
if direction:
lua_items.append(f'{direction} = {escape_luastring(key)}')
else:
lua_items.append(f'{escape_luastring(key)}')
if key != '\0':
if direction:
lua_items.append(f'{direction} = {escape_luastring(key)}')
else:
lua_items.append(f'{escape_luastring(key)}')
lua_item = f'{self.name} = {{ {", ".join(lua_items)} }}'
# Fix newlines to match the indentation and remove the doubled comma.
indent = len(self.name) + 4 * (indent_level + 1)
Expand Down Expand Up @@ -200,13 +201,13 @@ def render_key_cycle(self):

# Latin alphabet.
Key("l_1", "@-_/1", label="@-_/", alt_label="1"),
Key("l_2", "abc2", loop="abcABC2", label="abc", alt_label="2"),
Key("l_3", "def3", loop="defDEF3", label="def", alt_label="3"),
Key("l_4", "ghi4", loop="ghiGHI4", label="ghi", alt_label="4"),
Key("l_5", "jkl5", loop="jklJKL5", label="jkl", alt_label="5"),
Key("l_6", "mno6", loop="mnoMNO6", label="mno", alt_label="6"),
Key("l_2", "abc\02", loop="abcABC2", label="abc", alt_label="2"),
Key("l_3", "def\03", loop="defDEF3", label="def", alt_label="3"),
Key("l_4", "ghi\04", loop="ghiGHI4", label="ghi", alt_label="4"),
Key("l_5", "jkl\05", loop="jklJKL5", label="jkl", alt_label="5"),
Key("l_6", "mno\06", loop="mnoMNO6", label="mno", alt_label="6"),
Key("l_7", "pqrs7", loop="pqrsPQRS7", label="pqrs", alt_label="7"),
Key("l_8", "tuv8", loop="tuvTUV8", label="tuv", alt_label="8"),
Key("l_8", "tuv\08", loop="tuvTUV8", label="tuv", alt_label="8"),
Key("l_9", "wxyz9", loop="wxyzWXYZ9", label="wxyz", alt_label="9"),
Key("l_0", "'\":;0", label="'\":;", alt_label="0"),
Key("l_P", ",.?!", label=",.?!"),
Expand Down

0 comments on commit 7e611ac

Please sign in to comment.