mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix "Unknown character" for action key with Talkback
This commit is contained in:
parent
4c04bb8375
commit
593ac9e35e
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user