OneDeadKey / kalamine

Keyboard Layout Maker
MIT License
100 stars 29 forks source link

Handle and document all geometries from YAML #173

Open glostis opened 3 months ago

glostis commented 3 months ago

Hi,

Many thanks for this great project!

I had been maintaining my custom XKB symbols by hand until now, I'm grateful that I can now rely on a tool that translates a human-readable format into XKB.

This PR exposes in the CLI help the list of available geometries. The help now looks like this:

$ python -m kalamine.cli new --help
Usage: python -m kalamine.cli new [OPTIONS] OUTPUT_FILE

  Create a new TOML layout description.

Options:
  --geometry [ANSI|ISO|ABNT|JIS|ALT|ERGO]
                                  Specify keyboard geometry (defaults to ISO).
  --altgr / --no-altgr            Set an AltGr layer (defaults to --no-altgr).
  --1dk / --no-1dk                Set a custom dead key (defaults to
                                  --no-1dk).
  --help                          Show this message and exit.

Also, before the PR, if you passed a geometry such as JIS, it was silently ignored and changed to ISO. The input geometry is now checked against the same list of geometries implemented in the YAML, and so all declared geometries are effectively supported.

Finally, the PR includes a minor altgtaltgr fix.