abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2View.java
diff options
context:
space:
mode:
authorJules Aguillon2025-03-15 16:13:16 +0100
committerGitHub2025-03-15 16:13:16 +0100
commit60b01927abed9479bed5fdbb268f049cfe609aea (patch)
tree9973eda25af20af2690afdfb18c529996dfe4d44 /srcs/juloo.keyboard2/Keyboard2View.java
parent9cfeb0f0c22dd649fcf32260925a5a84a731d1b3 (diff)
downloadunexpected-keyboard-60b01927abed9479bed5fdbb268f049cfe609aea.tar.gz
unexpected-keyboard-60b01927abed9479bed5fdbb268f049cfe609aea.zip
Selection mode (#913)
* Selection mode: Space to cancel the selection This adds the "selection mode", which is activated when text is selected in the text box. The selection mode is exited when the selection is cleared. While the selection mode is activated, the Space and Esc keys are modified into the "selection cancel" key, which remove the selection without changing the text. The space bar is otherwise easy to type by accident during a selection and causes the selected text to be deleted. * Selection mode: Move each ends of selection separately with slider When the selection mode is activated, the space bar sliders change how they affect the selection: - The left side of the slider moves the left position of the selection. To shrink the selection from the left side, the slider must be activated by sliding to the left, extending the selection temporarilly, then by sliding to the right. - The right side of the slider affects the right position if the selection.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2View.java')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2View.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java
index b561eb4..ab3e36b 100644
--- a/srcs/juloo.keyboard2/Keyboard2View.java
+++ b/srcs/juloo.keyboard2/Keyboard2View.java
@@ -139,6 +139,13 @@ public class Keyboard2View extends View
set_fake_ptr_latched(_compose_key, _compose_kv, pending, false);
}
+ /** Called from [Keybard2.onUpdateSelection]. */
+ public void set_selection_state(boolean selection_state)
+ {
+ set_fake_ptr_latched(KeyboardData.Key.EMPTY,
+ KeyValue.getKeyByName("selection_mode"), selection_state, true);
+ }
+
public KeyValue modifyKey(KeyValue k, Pointers.Modifiers mods)
{
return KeyModifier.modify(k, mods);