From 41777fdda61715a59be241f0be9a8e3385222888 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Thu, 18 Dec 2025 19:15:32 +0100 Subject: Disable selection mode in text editors (#1141) * Disable selection mode in text editors Selection mode removes the space bar key (which is replaced by the Esc key) and can be annoying in Emacs for example. Text editor users probably have the `esc` key available. * Refactor: Move EditorInfo related code to EditorConfig Add the new EditorConfig class that handles configuration extracted from the EditorInfo. It is accessible from the Config class for convenience. This aims at reducing the length of already large classes and group the code that was spread over several classes.--- srcs/juloo.keyboard2/Config.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'srcs/juloo.keyboard2/Config.java') diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index 5dbf030..577ace5 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -73,10 +73,9 @@ public final class Config public int clipboard_history_duration; // Dynamically set + /** Configuration options implied by the connected editor. */ + public EditorConfig editor_config; public boolean shouldOfferVoiceTyping; - public String actionLabel; // Might be 'null' - public int actionId; // Meaningful only when 'actionLabel' isn't 'null' - public boolean swapEnterActionKey; // Swap the "enter" and "action" keys public ExtraKeys extra_keys_subtype; public Map extra_keys_param; public Map extra_keys_custom; @@ -93,6 +92,7 @@ public final class Config private Config(SharedPreferences prefs, Resources res, IKeyEventHandler h, Boolean foldableUnfolded) { _prefs = prefs; + editor_config = new EditorConfig(); // static values marginTop = res.getDimension(R.dimen.margin_top); keyPadding = res.getDimension(R.dimen.key_padding); @@ -102,9 +102,6 @@ public final class Config refresh(res, foldableUnfolded); // initialized later shouldOfferVoiceTyping = false; - actionLabel = null; - actionId = 0; - swapEnterActionKey = false; extra_keys_subtype = null; handler = h; } -- cgit v1.2.3