abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/ComposeKey.java
diff options
context:
space:
mode:
authorJules Aguillon2024-02-12 23:23:38 +0100
committerJules Aguillon2024-02-17 23:28:31 +0100
commit63e7ac2e94bf9adafd0af6bcc9b5a790428d1ad1 (patch)
treee628fda69960802ebb774509e42af2479412d7a9 /srcs/juloo.keyboard2/ComposeKey.java
parent8c290732607692cd94247f7e3e9c80fad1dfe516 (diff)
downloadunexpected-keyboard-63e7ac2e94bf9adafd0af6bcc9b5a790428d1ad1.tar.gz
unexpected-keyboard-63e7ac2e94bf9adafd0af6bcc9b5a790428d1ad1.zip
compose: Add X11 compose sequences
compile.py implements a parser for X11's Compose.pre files. A lot of code is necessary to interpret character names but thanksfully, the name of most characters is contained in the file. The state machine is compiled into two char arrays which unfortunately requires an expensive initialisation and allocation.
Diffstat (limited to 'srcs/juloo.keyboard2/ComposeKey.java')
-rw-r--r--srcs/juloo.keyboard2/ComposeKey.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/srcs/juloo.keyboard2/ComposeKey.java b/srcs/juloo.keyboard2/ComposeKey.java
index 5b89560..173fcd7 100644
--- a/srcs/juloo.keyboard2/ComposeKey.java
+++ b/srcs/juloo.keyboard2/ComposeKey.java
@@ -28,7 +28,7 @@ public final class ComposeKey
static KeyValue apply(int state, char c)
{
char[] states = ComposeKeyData.states;
- short[] edges = ComposeKeyData.edges;
+ char[] edges = ComposeKeyData.edges;
int length = edges[state];
int next = Arrays.binarySearch(states, state + 1, state + length, c);
if (next < 0)
@@ -42,8 +42,8 @@ public final class ComposeKey
/** The [states] array represents the different states and their transition.
A state occupies one or several cells of the array:
- - The first cell is the result of the conpose sequence if the state is of
- size 1, [0] otherwise.
+ - The first cell is the result of the compose sequence if the state is of
+ size 1, unspecified otherwise.
- The remaining cells are the transitions, sorted alphabetically.
The [edges] array represents the transition state corresponding to each