Skip to content

Commit 63fdb8e

Browse files
committed
Keyboard.type() now just presses and releases the key indicated - doesn't releaseAll()
1 parent 2e140e4 commit 63fdb8e

File tree

1 file changed

+4
-7
lines changed
  • hardware/arduino/cores/arduino

1 file changed

+4
-7
lines changed

hardware/arduino/cores/arduino/HID.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,10 @@ void Keyboard_::releaseAll(void)
523523

524524
// type() does a press and release of the specified key.
525525
size_t Keyboard_::type(uint8_t c)
526-
{
527-
releaseAll();
528-
// Keydown
529-
press(c);
530-
// Keyup
531-
releaseAll();
532-
return 1;
526+
{
527+
uint8_t p = press(c); // Keydown
528+
uint8_t r = release(c); // Keyup
529+
return (p&r);
533530
}
534531

535532
#endif

0 commit comments

Comments
 (0)