Hi,
Over two weeks I've been looking for a solution to a small problem I have with arduino micro (Leonardo).
My keyboard is pt_BR and from what I could tell the arduino has its lib in en_US which makes it very difficult to use some characters, even if punctuation or 'ç' for example.
I've gone all over the internet, GitHub - Dukweeno/LocaleKeyboard.js: Modified Keyboard arduino lib to permit using different locale which apparently has some changes for some languages. Except the Brazilian.
My main problem is with the "/", I saw that in keyboard.cpp it has value 0x38, in pt_PT it is equal to 0x24 | SHIFT and in Brazilian Portuguese it is 0x2f.
Even making the changes directly in my keyboard.cpp I still encounter difficulties with this character.
For example: When I use / it gives me ";" But if I try to map on the English keyboard itself and use the ";" He gives me "ç".
Is there any way to change only the value of this key, for example by assigning it to my keyboard, or even replacing a key that is not in use, for example: "+"?
If you temporarily set your system to en_US, what character shows up when you press that key? That would be the character to use when you want the ç to show up.
johnwasser:
If you temporarily set your system to en_US, what character shows up when you press that key? That would be the character to use when you want the ç to show up.
Temporarily set to en_US it changes 'ç' to '/'.
However, some versions of windows 10 available in Brazil include only one language and due to administrative restrictions on the network it is not possible to install en_US Language.
Is there a way in the keyboard.cpp query to make the change to any key be used as '/' or simply by changing it from location?
How can you see on our keyboard the '/' and '?' Are on a key next to the ':' and '; "and this key is useless in the en_US layout.
I think you want key 56 on the 104-key keyboard. I think that is USB keycode 135 (0x87). Unfortunately you can't produce keycode 135 with the Keyboard library because when you add 136 to 135 you get 271 which won't fit into a uint8_t.
Maybe you can modify the Keyboard library to recognize the keycode 0x7F (Keyboard Mute) and substitute 0x87. Then put 0x7F in the '/' entry of the table (currently 0x38). The change will be in this section of .press() and .release().
} else { // it's a printing key
k = pgm_read_byte(_asciimap + k);
if (!k) {
setWriteError();
return 0;
}
if (k & 0x80) { // it's a capital letter or other character reached with shift
_keyReport.modifiers |= 0x02; // the left shift modifier
k &= 0x7F;
}
}
if (!k) {
setWriteError();
return 0;
}
if (k & 0x80) { // it's a capital letter or other character reached with shift
_keyReport.modifiers |= 0x02; // the left shift modifier
k &= 0x7F;
}
// ADD THIS PART
if (k == 0x7F) // Look for special keycode
k = 0x87; // Change to Key 56 ('/' on Brazilian keyboard)
// END OF "ADD THIS PART"
}
I did what you instructed me to do. It still did not work out.
Anyway, thank you for your help.
I'll keep trying to have something to do at least this '/'.
Thank you