rust-embedded-community / pc-keyboard

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

Azerty changes #42

Closed CHiPs44 closed 11 months ago

CHiPs44 commented 11 months ago

NB:

thejpster commented 11 months ago

I don't think CodePages are relevant here, because Rust has full Unicode support.

If you have a photograph showing these symbols on your keyboard, I'll happily add them. If they are not printed on the keycaps, but instead something your OS has decided to generate, then we'll have to think a bit more carefully about whether other OSes do the same thing.

thejpster commented 11 months ago

Looking at https://en.wikipedia.org/wiki/AZERTY, I certainly agree that on an ISO keyboard Oem5 should produce < (and > when shifted).

CHiPs44 commented 11 months ago

They don't appear on the keyboard, effectively, but are handy.

That's why I just added comments for now, as I was a little reluctant to implement them.

The only ones that are printed on a standard AZERTY keyboard are on E key, and belgian AZERTY variant has ³ on the ² top left key.

Another use of this is that it would delay the necessary management of dead keys.

For CP437/CP850, it is because Neotron is using 256 characters CP850 fonts by default and something related to PS/2 like this keyboard driver has now chances to be used in projects that deal with code pages.

thejpster commented 11 months ago

For CP437/CP850, it is because Neotron is using 256 characters CP850 fonts by default

Right, but that's entirely Neotron OS's problem in mapping unicode to whatever the screen can display. We don't need to note it here.

As noted above, I can take a PR for the symbols printed on the keycaps. For symbols not on the keycaps, I'll need to see some documentation that the proposed symbols are what people "usually" get when they press that key combination. Ideally evidence that that is what Windows does.

thejpster commented 11 months ago

Also, this may be a good time to split Azerty into French Azerty, Belgian Azerty and Dutch Azerty.

CHiPs44 commented 11 months ago

This PR is now reduced to the bare minimum.

About using Windows as a reference about AZERTY keyboard layout, many french speaking people tend to consider it as terrible.

About variants, I was only aware of 3: French, Belgian and recent AFNOR French (which resembles to the variant I use on Linux but has a few keys moved or redefined and thus is not compatible with existing keyboards).

https://en.wikipedia.org/wiki/AZERTY seems to be exhaustive and authoritative.

thejpster commented 11 months ago

And I thought QWERTY was confusing!

LGTM. Perhaps you could open an issue proposing additional key mappings, citing precedent (and I'm happy to accept Windows might not be a good precedent, although I've never used it outside of US or UK locales). We can discuss them there, and then do one PR that implements them?