From 85cdb9b2b5e4a43ace04e97dbfa7350aa84efedc Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 3 Jun 2023 18:11:42 +0200 Subject: Add Voice Typing key The new key switches to any installed "voice" input method. If several input methods matches, no effort is made to choose. Might misbehave with some input methods other than Google's on API < 28. It is placed on the middle of the arrows on the bottom bar. It is enabled by default and can be removed in the "Extra keys" option. The key is not removed from the keyboard if no voice input method exists. --- srcs/juloo.keyboard2/KeyValue.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'srcs/juloo.keyboard2/KeyValue.java') diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 3e84ce8..9f4d985 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -19,6 +19,7 @@ final class KeyValue SWITCH_SECOND_BACK, SWITCH_GREEKMATH, CAPS_LOCK, + SWITCH_VOICE_TYPING, } // Must be evaluated in the reverse order of their values. @@ -343,6 +344,7 @@ final class KeyValue case "change_method_prev": return eventKey(0x09, Event.CHANGE_METHOD_PREV, FLAG_SMALLER_FONT); case "action": return eventKey("Action", Event.ACTION, FLAG_SMALLER_FONT); // Will always be replaced case "capslock": return eventKey(0x12, Event.CAPS_LOCK, 0); + case "voice_typing": return eventKey(0x15, Event.SWITCH_VOICE_TYPING, FLAG_SMALLER_FONT); case "esc": return keyeventKey("Esc", KeyEvent.KEYCODE_ESCAPE, FLAG_SMALLER_FONT); case "enter": return keyeventKey(0x0E, KeyEvent.KEYCODE_ENTER, 0); @@ -451,6 +453,7 @@ final class KeyValue /* Keys description is shown in the settings. */ addKeyDescr("capslock", "Caps lock"); addKeyDescr("switch_greekmath", "Greek & math symbols"); + addKeyDescr("voice_typing", "Voice typing"); } // Substitute for [assert], which has no effect on Android. -- cgit v1.2.3