Hey guys, I hope you can help me.
The problem with keyboard.h include is:
Ex:
Www.google.com/user
BUT, write
Www.google.com;user
The code change "/" for ";"
Thks
Hey guys, I hope you can help me.
The problem with keyboard.h include is:
Ex:
Www.google.com/user
BUT, write
Www.google.com;user
The code change "/" for ";"
Thks
Which language is your keyboard designed for ? Probably need to Use American English key layout....
My keyboard is destined for Portuguese from Brazil
GilMedeiros:
My keyboard is destined for Portuguese from Brazil
Looks like the '/' key on your keyboard is Shift-7. On a US keyboard that is '&' so try putting an '&' where you want a '/'.
johnwasser:
Looks like the '/' key on your keyboard is Shift-7. On a US keyboard that is '&' so try putting an '&' where you want a '/'.
The "/" on my keyboard is ALT + Q
Shift+7 = &
I try change the code from Keyboard.cpp and nothing happens.
The Keyboard library doesn't do ALT, only SHIFT. Assuming your 'Q' key is the same as the US 'Q' key you should be able to type ALT+Q with:
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press('q');
Keyboard.release('q');
Keyboard.release(KEY_LEFT_ALT);
having a quick look on my mac, this is what I see for the US keyboard and for a Brazilian keyboard
In red you see why generating the press on '/' on the US keyboard translates into a ';' in the Brazilian keyboard
In green you see what needs to be pressed on the US Keyboard so that it translates into the '/' key in the brazilian keyboard
so I would try to generate KEY_LEFT_ALT + SHIFT + q
johnwasser:
The Keyboard library doesn't do ALT, only SHIFT. Assuming your 'Q' key is the same as the US 'Q' key you should be able to type ALT+Q with:
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press('q');
Keyboard.release('q');
Keyboard.release(KEY_LEFT_ALT);
Many thanks, but where do I put this code?
J-M-L:
having a quick look on my mac, this is what I see for the US keyboard and for a Brazilian keyboardIn red you see why generating the press on '/' on the US keyboard translates into a ';' in the Brazilian keyboard
In green you see what needs to be pressed on the US Keyboard so that it translates into the '/' key in the brazilian keyboard
so I would try to generate
KEY_LEFT_ALT + SHIFT + q
Many thanks for your attention, gave me an idea of what to do.
GilMedeiros:
Many thanks, but where do I put this code?
You put it where you want to send a '/' character. From context I think you want:
Keyboard.write("www.google.com");
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press('q');
Keyboard.release('q');
Keyboard.release(KEY_LEFT_ALT);
Keyboard.write("user");
From context I think you want:
I think
Keyboard.write("www.google.com");
SendSlash();
Keyboard.write("user");
void SendSlash()
{
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press('q');
Keyboard.release('q');
Keyboard.release(KEY_LEFT_ALT);
}
would be a better approach. It is more obvious what the code does when the function name means something. The function can be used in multiple places, too.
Editing the library to match your needs (where possible) might also be an alternative
Thank you to everyone who helped me.
I was able to solve my problem with your help.
SOLVED
For the other forum members it's usually a best practice to document how you ended up solving your challenge
J-M-L:
Editing the library to match your needs (where possible) might also be an alternative
The existing library uses 7 bits of the lookup table for the key code and 1 bit to handle the SHIFT modifier. Adding a second modifier (like ALT-GR) would not be a small task.