diff options
| author | Jules Aguillon | 2023-08-26 23:44:41 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2023-08-26 23:44:41 +0200 |
| commit | 9b917e79b1f06604b253548e24c0b8ab32a3a56d (patch) | |
| tree | 30f02748dd2350d434f6cf85a471f6635fe7bf2f /srcs | |
| parent | f4c11d99ed589c53229bf70d31ff71b8ac3e3ef1 (diff) | |
| download | unexpected-keyboard-9b917e79b1f06604b253548e24c0b8ab32a3a56d.tar.gz unexpected-keyboard-9b917e79b1f06604b253548e24c0b8ab32a3a56d.zip | |
Fix regression on Ctrl on space bar slider
This makes Ctrl+move_cursor the same as before 5123ce5.
Diffstat (limited to 'srcs')
| -rw-r--r-- | srcs/juloo.keyboard2/KeyEventHandler.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java index c1f0a89..e903bdb 100644 --- a/srcs/juloo.keyboard2/KeyEventHandler.java +++ b/srcs/juloo.keyboard2/KeyEventHandler.java @@ -183,14 +183,20 @@ class KeyEventHandler implements Config.IKeyEventHandler } /** Move the cursor right or left, if possible without sending key events. - Unlike arrow keys, the selection is not removed even if shift is not on. */ + Unlike arrow keys, the selection is not removed even if shift is not on. + Falls back to sending arrow keys events if the editor do not support + moving the cursor or a modifier other than shift is pressed. */ void move_cursor(int d, Pointers.Modifiers mods) { InputConnection conn = _recv.getCurrentInputConnection(); if (conn == null) return; ExtractedText et = get_cursor_pos(conn); - if (et == null) // Editor doesn't support moving the cursor + // Fallback to sending key events + if (et == null + || mods.has(KeyValue.Modifier.CTRL) + || mods.has(KeyValue.Modifier.ALT) + || mods.has(KeyValue.Modifier.META)) { move_cursor_fallback(d, mods); return; |
