Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Compose key #559

Merged
merged 9 commits into from
Feb 17, 2024
Merged

Add the Compose key #559

merged 9 commits into from
Feb 17, 2024

Conversation

Julow
Copy link
Owner

@Julow Julow commented Feb 17, 2024

Closes #204

X11 compose sequences are supported, though several of them cannot be used due to either unknown symbol names or to characters wider than 16 bits. It is plan to fix this limitation in the future.

The COMPOSE_PENDING modifier indicate whether a compose sequence is in
progress. The new key of kind Compose_pending sets the current state of
the sequence.

The compose sequences are compiled into a state machine by a python
script into a compact encoding.

The state of the pending compose is determined by the index of a state.
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.
Keys that are not part of any possible sequences are now dimmed and
still usable instead of being removed, which felt weird.
The kind field wasn't large enough to hold the new Compose_pending kind.
The flags field is reduced in size by removing a free spot.

The FLAGS_BITS mask is defined in a safer way.
Themes do not dim secondary keys the same way due to the "offset"
mechanism. Instead, use a ratio that is the same for every themes.

It's still possible to override this ratio per theme.
Keys that are not in the pending compose sequence are greyed out with
the new 'FLAG_GREYED' flag.
Though it is not useful in the greek-math layout, it could give ideas
for new sequences.
@Julow Julow merged commit e405586 into master Feb 17, 2024
6 checks passed
@Julow Julow deleted the compose-key branch May 2, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Compose key
1 participant