Closed brendanballon closed 2 years ago
What kind of apostrophe are you trying to type? ASCII quote (U+0027 = '
)? Right single quotation mark (U+2019 = ’
)?
What keyboard layout is configured on your computer? What keyboard layout did you set with Keyboard.begin()
?
I managed to reproduce the issue. The “apostrophe” was actually the non-ASCII character “right single quotation mark” (U+2019 = ’
). Here is a test sketch:
#include <Keyboard.h>
void setup() {
Keyboard.begin();
delay(5000);
Keyboard.print("’");
}
void loop(){}
The character ’
is written in UTF-8 as the sequence (0xe2
, 0x80
, 0x99
). These all being non-ASCII codes, they are interpreted by the library as “special” keys, namely:
0xe2
= KEY_KP_2
(key “2” of the numeric keypad)0x80
= KEY_LEFT_CTRL
0x99
= 'n'
Since this library only supports ASCII, I think the issue could be closed as invalid. On the other hand, the documentation does not state explicitly the limitation to only ASCII, so this could be an issue to be filed against the documentation.
Edit: looking at that manual again, it seems the documenttaion of Keyboard.write()
is explicit enough:
Only ASCII characters that are on the keyboard are supported. [...] For a complete list of ASCII characters, see ASCIITable.com.
Like the title says, when I write an apostrophe it types "2n". I cannot figure this out and it happens on other operating systems other than Mac.