I mean that if we want to write very special characters, we can create an OS keyboard layout that contain theses characters
I do not know. I have never attempted to create a custom keyboard layout on any operating system. I do not even know if this is possible on Windows and Macintosh, whether users can do this or if it's a feature only Microsoft & Apple can control.
Is there a quick way to see which key's are the same on almost all layouts and which combinations have a special meaning on several Os'es?
When I created the set of layouts for Teensyduino, I mostly used an older version of
this Microsoft documentation (the old site seems to be gone), and a couple wikipedia pages.
Many other websites exist with info about keyboard layouts. I have not looked at most of them. If you find a really good one for this purpose, please share.
There are a few complexities to keep in mind with keyboard layouts, which make everything much more difficult...
1: Most non-US keyboards uses the right side Alt key to assign a 3rd character to many keys. On US keyboards every key does only 2 things, depending on whether you press the shift key. But 3 or even 4 functions (Alt + Shift) are common for other layouts.
2: Many non-US layouts use "dead key" sequences, usually for typing seldom-used accents. So the character depends not only on the key plus a modifier held, but the sequence of which key you
previously pressed. For example, on the French Canadian keyboard, to type "ü", you first press the "]" key and then press "u". You don't hold it while pressing "u", you actually press and release them in sequence to achieve a single character typed.
3: The worst problem of all are the completely alternate layouts, like Cyrillic chars used by Russian language. Using these requires vision of the screen or knowledge of the PC's settings, which obviously Teensy doesn't have. Humans with these keyboards actually switch their OS setting to remap the entire keyboard between the alternate character sets as they type. This system fundamentally relies on the person remembering which mode they currently have selected, or looking at a visual indication on their screen if they are unsure, or just typing a couple keystrokes and visually noticing they are from the other layout. Worst of all, the user input toggles between the sets, which works well for humans with eyesight and short term memory, so there isn't any well defined input Teensy can send that puts the OS into a particular mode. Being able to toggle or cycle modes doen't help if you don't know the current mode and have no way to observe as you send the keystrokes.