Keyboard emulation special chars on non standard locale

Hello everyone

I have been busy programming the Arduino Leonardo with the goal of automating a Chromebook setup.

This works good, I have found This Dutch topic to put the Arduino in AZERTY mode, this works fine for the characters I have been using (TAB, nonspecial charachters) but I am stuck on the @ symbol, needed for entering an email address.

I can't get this to work.

What I have already tested:

Keyboard.print("@") //returns à

Keyboard.press(134) //Right ALT, from this link: [KeyboardModifiers](https://www.arduino.cc/en/Reference/KeyboardModifiers)
Keyboard.press(31) //Following the previous Dutch topic, this is the 2, dIt should be pressed together to get the @
Keyboard.releaseAll //Output : 13

No worky, so I tried using the ALT code:

Keyboard.Press(130) //Alt : [KeyboardModifiers](https://www.arduino.cc/en/Reference/KeyboardModifiers)
Keyboard.Press(235) //numpad 0
Keyboard.Release(235)
Keyboard.Press(231) //numpad 6
Keyboard.Release(231)
Keyboard.Press(229) //numpad 4
Keyboard.Release(229)
Keyboard.ReleaseAll // Return: 12

Does anyone know how to type out a @ sign from a Leonardo from a AZERTY locale. To be clear, I have replaced the asciimap code in Keyboard.cpp with the one found here:

https://github.com/Dukweeno/LocaleKeyboard.js/blob/master/locales/be_BE.lang

Thanks a bunch!

From your table 0x27, // @

So the value to send should be 0x27 or 39 decimal.

Hi @Whandall I forgot to mention, I tested that one out too.

Won't work either, it shows a 3 and all other letter after that one are in capital, so I guess that is a shift lock button.

I guess the locale is just wrong tho. Is there any way I can check the button key value?

On the Dutch keyboard:

The '@' is in the top left corner. Use the '`' (Grave Accent) character (same key on the US keyboard) to get that character.

To put that in the table I think you would put it in character 53:

const char Lowercase = {
0, 0, 0, 0, ‘q’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’,  // 0-9
‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘,’, ‘n’, ‘o’, ‘p’, // 10-19
‘a’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘z’, ‘x’, ‘y’, ‘w’, // 20-29
‘&’, ‘é’, ‘"’, ‘’’, ‘(’, ‘§’, ‘è’, ‘!’, ‘ç’, ‘à’, ‘\n’, // 30-39
0, 0, 0, ’ ', ‘)’, ‘-’, ‘^’, ‘$’, 0, ‘µ’, // 40-49
‘m’, ‘ù’, ‘²’, ‘@’, ‘:’, ‘=’, 0, 0, 0, 0, // 50-59
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60-69
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 70-79
0, 0, 0, ‘/’, ‘*’, ‘-’, ‘+’, ‘\n’, ‘1’, ‘2’, ‘3’, // 80-89
‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘0’, ‘.’, ‘<’, 0 // 90-99
};

53 (0x35) is the USB keycode for the key in the upper left corner of the keyboard.

USB Scan Codes (hex)

[35][1E][1F][20][21][22][23][24][25][26][27][2D][2E][ 2A ]
[2B ][14][1A][08][15][17][1C][A0][0C][12][13][2f][30][31]
[39 ] [04][16][07][09][0A][0B][0D][0E][0F][33][34][  28  ]
[Shift ][1D][1B][06][19][05][11][10][36][37][38][Shift ]
                    [   2C   ]

Did you want a BELGIAN keyboard layout or a DUTCH keyboard layout?

Windows has three different Belgian keyboards. On this one:

The '@' is AltGr-2. You can't put that in _asciimap because the ASCII map has no way to specify an AltGr shift. I would try:

  Keyboard.press(KEY_RIGHT_ALT);
  Keyboard.press('2');
  Keyboard.releaseAll();

What is the exact key or key-combination to press on a real keyboard to get the @-Symbol?

For example on a german keyboard it is AltGr-q which as USB-keyboard-code is
letter q combined with modifier Ctrl and modifier Alt.

For testing it you should really know which keyboard-layout a real hardware-keyboard has.
best regards Stefan

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.