diff options
| author | Jules Aguillon | 2025-03-15 16:13:16 +0100 |
|---|---|---|
| committer | GitHub | 2025-03-15 16:13:16 +0100 |
| commit | 60b01927abed9479bed5fdbb268f049cfe609aea (patch) | |
| tree | 9973eda25af20af2690afdfb18c529996dfe4d44 /srcs/juloo.keyboard2/KeyValue.java | |
| parent | 9cfeb0f0c22dd649fcf32260925a5a84a731d1b3 (diff) | |
| download | unexpected-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/KeyValue.java')
| -rw-r--r-- | srcs/juloo.keyboard2/KeyValue.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 413520d..ecfdd94 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -59,6 +59,7 @@ public final class KeyValue implements Comparable<KeyValue> BREVE, BAR, FN, + SELECTION_MODE, } // Last is be applied first public static enum Editing @@ -77,6 +78,7 @@ public final class KeyValue implements Comparable<KeyValue> AUTOFILL, DELETE_WORD, FORWARD_DELETE_WORD, + SELECTION_CANCEL, } public static enum Placeholder @@ -715,6 +717,9 @@ public final class KeyValue implements Comparable<KeyValue> case "cursor_right": return sliderKey(Slider.Cursor_right, 1); case "cursor_up": return sliderKey(Slider.Cursor_up, 1); case "cursor_down": return sliderKey(Slider.Cursor_down, 1); + case "selection_cancel": return editingKey("Esc", Editing.SELECTION_CANCEL, FLAG_SMALLER_FONT); + case "selection_cursor_left": return sliderKey(Slider.Selection_cursor_left, -1); // Move the left side of the selection + case "selection_cursor_right": return sliderKey(Slider.Selection_cursor_right, 1); // These keys are not used case "replaceText": return editingKey("repl", Editing.REPLACE); case "textAssist": return editingKey(0xE038, Editing.ASSIST); @@ -764,6 +769,9 @@ public final class KeyValue implements Comparable<KeyValue> case "௲": case "௳": return makeStringKey(name, FLAG_SMALLER_FONT); + /* Internal keys */ + case "selection_mode": return makeInternalModifier(Modifier.SELECTION_MODE); + default: return null; } } @@ -780,7 +788,9 @@ public final class KeyValue implements Comparable<KeyValue> Cursor_left(0xE008), Cursor_right(0xE006), Cursor_up(0xE005), - Cursor_down(0xE007); + Cursor_down(0xE007), + Selection_cursor_left(0xE008), + Selection_cursor_right(0xE006); final String symbol; |
