abouttreesummaryrefslogcommitdiff
path: root/gen_layouts.py
diff options
context:
space:
mode:
authorJules Aguillon2023-07-29 18:37:06 +0200
committerJules Aguillon2023-07-30 21:44:14 +0200
commitdad5f57a036e3f0ad7278ccee5bd248192cbbad2 (patch)
tree022b170f190edcf204dc453a49e83193821aeb80 /gen_layouts.py
parent818aa4c7d597116ed595e960d4415b57ed56d2ec (diff)
downloadunexpected-keyboard-dad5f57a036e3f0ad7278ccee5bd248192cbbad2.tar.gz
unexpected-keyboard-dad5f57a036e3f0ad7278ccee5bd248192cbbad2.zip
Allow more than 2 layouts
The two layout selection options are replaced by a ListGroupPreference that allow to enter an arbitrary amount of layouts. The "switch_second" and "switch_second_back" keys are replaced by "switch_forward" and "switch_backward", which allow to cycle through the selected layouts in two directions. Layouts are changed to place these two key on the space bar. The backward key is not shown if there's only two layouts.
Diffstat (limited to 'gen_layouts.py')
-rw-r--r--gen_layouts.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gen_layouts.py b/gen_layouts.py
index a8f13c8..44c3563 100644
--- a/gen_layouts.py
+++ b/gen_layouts.py
@@ -54,10 +54,10 @@ def generate_arrays(out, layouts):
item.text = s
elem.append(item)
return elem
- none_item = [ ("none", "None") ]
+ none_item = [ ("system", "@string/pref_layout_e_system") ]
custom_item = [ ("custom", "@string/pref_layout_e_custom") ]
values_items, entries_items = zip(*(none_item + layouts + custom_item)) # unzip
- ids_items = map(lambda s: "@xml/%s" % s if s not in ["none", "custom"] else "-1", values_items)
+ ids_items = map(lambda s: "@xml/%s" % s if s not in ["system", "custom"] else "-1", values_items)
root = XML.Element("resources")
root.append(XML.Comment(text="DO NOT EDIT. This file is generated, see gen_layouts.py."))
root.append(mk_array("string-array", "pref_layout_values", values_items))