Skip to content

Commit 977e7b4

Browse files
committed
Fix println by replacing \n with KEY_ENTER
Fixes #13 and #14
1 parent 577e5c9 commit 977e7b4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Keyboard.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,13 @@ void Keyboard_::releaseAll(void)
311311
}
312312

313313
size_t Keyboard_::write(uint8_t c)
314-
{
314+
{
315+
if (c == '\r') {
316+
return c;
317+
}
318+
if (c == '\n') {
319+
c = KEY_RETURN;
320+
}
315321
uint8_t p = press(c); // Keydown
316322
release(c); // Keyup
317323
return p; // just return the result of press() since release() almost always returns 1

0 commit comments

Comments
 (0)