fdivitto / FabGL

ESP32 Display Controller (VGA, PAL/NTSC Color Composite, SSD1306, ST7789, ILI9341), PS/2 Mouse and Keyboard Controller, Graphics Library, Sound Engine, Game Engine and ANSI/VT Terminal
http://www.fabglib.org
Other
1.45k stars 217 forks source link

Adding norwegian keyboard support to FabGL library #205

Closed zakariassen closed 2 years ago

zakariassen commented 2 years ago

Hello,

I have amended the files /src/devdrivers/kbdlayouts.h/.cpp to provide a Norwegian keyboard layout for FabGL. As the norwegian alphabet has three additional letters compared to the US/UK alphabet, would I be correct to assume that the Virtual key to string definitions for these chars also have to be added to keyboard.cpp?

The letters in question are:

Glyph html code Keyboard placement scancode
æ / Æ aelig; / AElig; OEM_7 52
ø / Ø oslash; /Oslash; OEM_3 4C
å / Å aring; / Aring; OEM_6 54

The letters are considered "full" letters, and not just accented versions of others.

As pushing files to the repo is not allowed, what is the preferred way to upload the amended files?

Regards,

Knut Zakariassen

zakariassen commented 2 years ago

kbdlayouts.cpp.txt kbdlayouts.h.txt

Uploading the amended files here, so they can be checked and the amended section added to src.

fdivitto commented 2 years ago

Thank you for this addition, and sorry for the delay. Could you suggest an ASCII name for the three virtual keys? Something like VK_AELIG, VK_OSLASH, VK_ARING....but I am not sure if this is right!

zakariassen commented 2 years ago

Ideally, since the chars are considered "full" letters in the norwegian alphabet and not accented version of others, the preferable ASCII names would be VK_æ, VK_ø and VK_å. In practice, though, going by the html name as you suggest probably will be easier to understand and use for non-norwegians.

VK_aelig, VK_oslash and VK_aring are good "common-ground" names :)

GmEsoft commented 2 years ago

Hi Knut,

As you should know, ASCII stands for American Standard Code for Information Interchange. It is a 7-bit coded character set, consisting in 32 control characters and 96 displayable characters, with the 26 Latin alphabet characters in upper and lower case, without accenting of any kind, the 10 digits and some punctuation and mathematical characters. The "preferable ASCII names" you suggest are not using plain ASCII chars, and are generally invalid to C++. The "common-ground" names are instead valid identifiers to C++.

Kind regards,

Michel Bernard

Sent from my iPhone

Le 10 avr. 2022 à 12:33, Knut Zakariassen @.***> a écrit :

 Ideally, since the chars are considered "full" letters in the norwegian alphabet and not accented version of others, the preferable ASCII names would be VK_æ, VK_ø and VK_å. In practice, though, going by the html name as you suggest probably will be easier to understand and use for non-norwegians.

VK_aelig, VK_oslash and VK_aring are good "common-ground" names :)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

zakariassen commented 2 years ago

Michel et al,

Indeed, and thanks for explaining better what I suspected all along. My profession is languages, not programming, so please forgive the misunderstanding.

Kind regards, Knut Zakariassen

fdivitto commented 2 years ago

Ok, changes pushed. I haven't a Norwegian keyboard, so I cannot actually test it.

Thanks for the submission, and feel free to reopen the issue in case there are problems.