From ec8efcd678a9dfd70caa2dfb07c307d818a20fb9 Mon Sep 17 00:00:00 2001 From: Devy Ballard <69347329+devycarol@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:51:42 -0600 Subject: [PATCH] Small changes to toolbar long-clicks (#959) * make "select all" key select word on long press * long-press 'copy' to cut text (instead of copy all) --- README.md | 2 +- .../main/java/helium314/keyboard/latin/utils/ToolbarUtils.kt | 3 ++- app/src/main/res/values/strings.xml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9b1eb4c0..a0d4a0cc 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Does not use internet permission, and thus is 100% offline. ## Hidden Functionality Features that may go unnoticed, and further potentially useful information -* Long-pressing toolbar keys results in additional functionality: clipboard -> paste, move left/right -> word left/right, move up/down -> page up/down, word left/right -> line start/end, page up/down -> page start/end, copy -> copy all, select word -> select all, undo <-> redo +* Long-pressing toolbar keys results in additional functionality: clipboard -> paste, move left/right -> word left/right, move up/down -> page up/down, word left/right -> line start/end, page up/down -> page start/end, copy -> cut, select word <-> select all, undo <-> redo * Long-press the Comma-key to access Clipboard View, Emoji View, One-handed Mode, Settings, or Switch Language: * Emoji View and Language Switch will disappear if you have the corresponding key enabled; * For some layouts it\'s not the Comma-key, but the key at the same position (e.g. it\'s `q` for Dvorak layout). diff --git a/app/src/main/java/helium314/keyboard/latin/utils/ToolbarUtils.kt b/app/src/main/java/helium314/keyboard/latin/utils/ToolbarUtils.kt index 5b48b813..6b02feac 100644 --- a/app/src/main/java/helium314/keyboard/latin/utils/ToolbarUtils.kt +++ b/app/src/main/java/helium314/keyboard/latin/utils/ToolbarUtils.kt @@ -70,8 +70,9 @@ fun getCodeForToolbarKeyLongClick(key: ToolbarKey) = when (key) { CLIPBOARD -> KeyCode.CLIPBOARD_PASTE UNDO -> KeyCode.REDO REDO -> KeyCode.UNDO + SELECT_ALL -> KeyCode.CLIPBOARD_SELECT_WORD SELECT_WORD -> KeyCode.CLIPBOARD_SELECT_ALL - COPY -> KeyCode.CLIPBOARD_COPY_ALL + COPY -> KeyCode.CLIPBOARD_CUT PASTE -> KeyCode.CLIPBOARD LEFT -> KeyCode.WORD_LEFT RIGHT -> KeyCode.WORD_RIGHT diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0f536083..4505f923 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -812,8 +812,8 @@ New dictionary: \n\t• move up/down &#65515; page up/down <br> \n\t• word left/right &#65515; line start/end <br> \n\t• page up/down &#65515; page start/end <br> -\n\t• copy &#65515; copy all <br> -\n\t• select word &#65515; select all <br> +\n\t• copy &#65515; cut <br> +\n\t• select word &#8596; select all <br> \n\t• undo &#8596; redo <br> <br> \n► Long-pressing keys in the suggestion strip toolbar pins them to the suggestion strip. <br> <br> \n► Long-press the Comma-key to access Clipboard View, Emoji View, One-handed Mode, Settings, or Switch Language: <br>