rust-embedded-community / pc-keyboard

PS/2 Keyboard Decoder in Rust
Apache License 2.0
99 stars 28 forks source link

Azerty FR / BE, AltGr (+ Shift) supplemental characters & dead keys #43

Open CHiPs44 opened 11 months ago

CHiPs44 commented 11 months ago

This follows PR https://github.com/rust-embedded-community/pc-keyboard/pull/42.

It should be desirable to split Azerty layout between Azerty FR (France) and Azerty BE (Belgium), as described on https://en.wikipedia.org/wiki/AZERTY, as they are significantly different.

Belgian official layout includes some AltGr and AltGr + Shift combinations to handle otherwise not available characters like ³.

"Français (variante)" as available in GNU/Linux Ubuntu 22.04 or Debian, authorize more combinations to handle for example characters like ¹²³≤≥«»“”æÆœŒÉ, see file /usr/share/X11/xkb/symbols/fr from package xkbd-data or Debian source file https://sources.debian.org/src/xkeyboard-config/2.35.1-1/symbols/fr/. Belgian GNU/Linux keyboard has similar enhancements.

It could be a good idea to include these supplemental definitions, even if they're not displayed on the keys, and even if dead keys were to be implemented.

For now, AFNOR 2019 layout should not be included until it is more used as it requires new hardware that is still not widely available.

Feel free to amend this issue by suggesting changes, as it is much more long and complex as I intended.

CHiPs44 commented 10 months ago

This project aims to make a comprehensive library of keyboard layouts in JSON: https://github.com/hid-io/layouts/.

It can be a great source to implement generators from JSON to Rust, be in Python or another language.

CHiPs44 commented 10 months ago

And there is https://kbdlayout.info/, too, even if it is very Windows oriented.

thejpster commented 10 months ago

We seem to already support more layouts that https://github.com/hid-io/layouts/ does. In principle I'm not against having a text format describe the layouts. We could even do the automatic de-duplication of keys, e.g. between ANSI US-English and ISO British-English.

https://kbdlayout.info/ is very useful - I've used it before.

CHiPs44 commented 10 months ago

I thought there were more layouts in hid-io... I found the idea of describing keyboards in JSON files, with "inheritance", very elegant.

I saw another project downloading XML from kdb-layouts to generate specific files: https://github.com/Neradoc/Circuitpython_Keyboard_Layouts.