Skip to content
Snippets Groups Projects
Commit 593ac9e3 authored by Aleksandras Kostarevas's avatar Aleksandras Kostarevas
Browse files

Fix "Unknown character" for action key with Talkback

parent 4c04bb83
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ import org.futo.inputmethod.keyboard.KeyboardId;
import org.futo.inputmethod.latin.R;
import org.futo.inputmethod.latin.common.Constants;
import org.futo.inputmethod.latin.common.StringUtils;
import org.futo.inputmethod.latin.uix.actions.ActionRegistry;
import java.util.Locale;
......@@ -285,6 +286,12 @@ final class KeyCodeDescriptionMapper {
if (Character.isDefined(codePoint) && !Character.isISOControl(codePoint)) {
return StringUtils.newSingleCodePointString(codePoint);
}
if(codePoint <= Constants.CODE_ACTION_MAX && codePoint >= Constants.CODE_ACTION_0) {
final int actionId = codePoint - Constants.CODE_ACTION_0;
return ActionRegistry.INSTANCE.actionIdToName(context, actionId);
}
return null;
}
......
......@@ -89,6 +89,10 @@ object ActionRegistry {
return action.toIntOrNull() ?: ActionIdToInt[action] ?: throw IllegalArgumentException("Unknown action $actionString")
}
fun actionIdToName(context: Context, id: Int): String {
return context.getString(AllActions[id].name)
}
}
val DefaultActions = listOf(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment