From ebf80415d8034d853bd79ba7cfb578db67862529 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Thu, 19 Feb 2026 00:35:14 +0100 Subject: Refactor: KeyValue constants (#1180) * Refactor: KeyValue constants Add constants for keys that are accessed from the app's code. This simplifies the fake pointer handling in Keyboard2View. * Refactor: Pre-compute action key replacement The action key and the enter swap are pre-computed in EditorConfig. This simplifies the code.--- srcs/juloo.keyboard2/KeyModifier.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'srcs/juloo.keyboard2/KeyModifier.java') diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java index cf9af3b..c40c342 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -109,9 +109,9 @@ public final class KeyModifier { case CHANGE_METHOD_PREV: case CHANGE_METHOD_NEXT: - return KeyValue.getKeyByName("change_method"); + return KeyValue.CHANGE_METHOD; case SWITCH_VOICE_TYPING: - return KeyValue.getKeyByName("voice_typing_chooser"); + return KeyValue.VOICE_TYPING_CHOOSER; } break; } @@ -150,7 +150,7 @@ public final class KeyModifier return res; /* Tapping compose again exits the pending sequence. */ case Compose_pending: - return KeyValue.getKeyByName("compose_cancel"); + return KeyValue.COMPOSE_CANCEL; /* These keys are not greyed. */ case Event: case Modifier: -- cgit v1.2.3