Support for CapsLock mappings
meta-space opened this issue · 2 comments
Hi
I noticed that the Swiss-german keyboard layout ( http://ascii-table.com/keyboard.php/150G ) hasn't been implemented yet.
I was thinking about contributing it myself, but I fear that it might not be possible to fully implement it at the moment.
All layouts I've seen have the following data structure:
const layout = {
default: [ ... ],
shift: [ ... ]
};
Due to some oddities in the Swiss system, the Shift and Caps-Lock keymaps are not identical. Specifically if you want type capital ÖÜÄ, you can only do it using Caps-Lock. When you use Shift, it will type the French accents éèà. Does simple-keyboard support this scenario? Ideally, I could provide a keyboard layout such as:
const layout = {
default: [ ... ],
shift: [ ... ],
capslock: [... ],
};
If no capslock is provided in a layout, you could fallback to shift.
Hey @meta-space, simple-keyboard does support different actions for shift and caps-lock.
However, I would prefer if the layouts in simple-keyboard-layouts
have the same structure.
The reason for this is that any change in layout structure here can potentially break people's implementations, especially if they're using these layouts in a language switcher such as this one. Shift handling is not done in the library, it's something that every dev handles in their onKeyPress
function.
You are more than welcome to submit a "simplified" version of the Swiss-german layout though!
Regards,
Francisco Hodge
I hadn't seen that demo. That's what I was looking for, thanks!