-
Notifications
You must be signed in to change notification settings - Fork 165
Keyboard Layout for Swedish #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard Layout for Swedish #58
Conversation
Memory usage change @ 20f7498
Click for full report table
Click for full report CSV
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see more layouts coming! 😄 I do not use a Swedish layout myself, but just tried to review this based on pictures I found on the Internet, and on trying to set that layout on my computer. Please, tell me if I made any mistake.
Oh, I almost forgot. You should declare the layout in Keyboard.h: --- a/src/Keyboard.h
+++ b/src/Keyboard.h
@@ -116,6 +116,7 @@ extern const uint8_t KeyboardLayout_en_US[];
extern const uint8_t KeyboardLayout_es_ES[];
extern const uint8_t KeyboardLayout_fr_FR[];
extern const uint8_t KeyboardLayout_it_IT[];
+extern const uint8_t KeyboardLayout_sv_SE[];
// Low level key report: up to 6 keys and shift, ctrl etc at once
typedef struct |
Co-authored-by: Edgar Bonet <[email protected]>
Co-authored-by: Edgar Bonet <[email protected]>
Co-authored-by: Edgar Bonet <[email protected]>
Co-authored-by: Edgar Bonet <[email protected]>
Co-authored-by: Edgar Bonet <[email protected]>
You are indeed right, and I had indeed done that for myself, but overlooked it. |
Co-authored-by: Edgar Bonet <[email protected]>
Edgar thanks very much for your detailed review. I'll double check the few items indicated above. The Swedish keyboard has some ambiguous (to a non-Swede) symbols and some unusual features versus a more familiar keyboard. |
Memory usage change @ cd9a30c
Click for full report table
Click for full report CSV
|
You mean the dead keys at the top right which are used for diacritics? We have dead keys on the French, German and Spanish layouts as well. |
Are we done? How do we get this into the master branch? |
"Only those with write access to this repository can merge pull requests" ... anyone? |
I tested this pull request (commit cd9a30c) with the following code: #include <Keyboard.h>
extern const uint8_t KeyboardLayout_sv_SE[];
void setup() {
Keyboard.begin(KeyboardLayout_sv_SE);
delay(5000);
Keyboard.print("<>\\|");
}
void loop(){} I switched, on my PC, my keyboard layout to Swedish, then uploaded the sketch to my Arduino Micro, and a few seconds later the Arduino typed the following:
This shows that:
Could you please run this sketch on your setup? If you get the same results, that would mean that at least the codes for I ran the same test with the fixes I proposed and I got the correct result, namely |
Using SWE layout I get same (<{/€). OK. I'll fix that (I have a SWE test keyboard handy). |
Also, don't forget to declare the layout in Keyboard.h. |
OK... one difference... it works in my project code when I use Keyboard.press() |
That should not make a difference. I modified my test sketch like this: void setup() {
Keyboard.begin(KeyboardLayout_sv_SE);
delay(5000);
Keyboard.press('<'); Keyboard.release('<');
Keyboard.press('>'); Keyboard.release('>');
Keyboard.press('\\'); Keyboard.release('\\');
Keyboard.press('|'); Keyboard.release('|');
} and got the same result: |
My suspicion at the moment is that Keyboard.press('<') plus a separate keyboard SHIFT modifier keypress works... which is how my current project functions (and that is fine). Where as Keyboard.press('>') lookup in KeyboardLayout_sv_SE returning 0x64|SHIFT as a single code, attempting to send that combo (which might relate to the comment in KeyboardLayout.h ("The exception is 0x64, the key next next to Left Shift on the ISO layout (and absent from the ANSI layout). We handle it by replacing its value by 0x32 in the layout arrays.") Which you did highlight, and I didn't understand... but now I still don't understand... but can see is relevant. I will try using 0x32 and see if that solves it :) |
OK, its fixed, this code was used to test; `#include <Keyboard.h> extern const uint8_t KeyboardLayout_sv_SE[]; void setup() { void loop(){}` And yields the right results now. I'll fix the sv_SE layout. |
Confirmed correct combination for bslash Co-authored-by: Edgar Bonet <[email protected]>
Co-authored-by: Edgar Bonet <[email protected]>
Co-authored-by: Edgar Bonet <[email protected]>
Co-authored-by: Edgar Bonet <[email protected]>
Hi Edgar... thank you. I believe all queries are resolved, your contributions were quite correct. Thank you very much for your help & review. Are you able to commit this contribution to the master branch now? regards |
Memory usage change @ 28735fd
Click for full report table
Click for full report CSV
|
Hi Pete! I do not have write access to this repository. I am just the contributor who implemented the support for multiple keyboard layouts, and the layouts fr_FR, it_IT, de_DE and es_ES (c.f. PR #53). This is why I am very glad to help others expand this support. BTW, do not forget to add your layout to Keyboard.h. |
Thanks again Edgar, a revised keyboard.h is also attached now. I hope someone will merge this pull request for us? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Memory usage change @ c62a5c7
Click for full report table
Click for full report CSV
|
Hi @agdl .. |
@facchinm are you able to merge this enhancement that Edgar & myself have created adding support for Swedish keyboards/scancodes to Keyboard? |
Since it's been approved by @edgar-bonet I'm squashing and merging it 🙂 |
.CPP file adds an ordinary Swedish keyboard layout.
.h file adds scancodes for the non-ascii characters commonly used on Swedish keyboards (a-ring etc).