1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

eliminated Keyboard.type() - unnecessary duplication of Keyboard.write() (David Mellis). Also edit KeyboardReprogram example which was the only example using type()

This commit is contained in:
Zach Eveland 2012-03-28 18:35:26 -04:00
parent 57b3395691
commit 3d15f3781a
3 changed files with 4 additions and 6 deletions

View File

@ -15,7 +15,7 @@
* wire to connect D2 to ground.
created 5 Mar 2012
modified 27 Mar 2012
modified 28 Mar 2012
by Tom Igoe
This example is in the public domain
@ -63,7 +63,7 @@ void loop() {
// 3000 ms is too long. Delete it:
for (int keystrokes=0; keystrokes < 6; keystrokes++) {
delay(500);
Keyboard.type(KEY_BACKSPACE);
Keyboard.write(KEY_BACKSPACE);
}
// make it 1000 instead:
Keyboard.println("1000);");

View File

@ -591,8 +591,7 @@ void Keyboard_::releaseAll(void)
sendReport(&_keyReport);
}
// type() does a press and release of the specified key.
size_t Keyboard_::type(uint8_t c)
size_t Keyboard_::write(uint8_t c)
{
uint8_t p = press(c); // Keydown
uint8_t r = release(c); // Keyup

View File

@ -126,8 +126,7 @@ public:
Keyboard_(void);
void begin(void);
void end(void);
virtual size_t write(uint8_t k) {return type(k);};
virtual size_t type(uint8_t k);
virtual size_t write(uint8_t k);
virtual size_t press(uint8_t k);
virtual size_t release(uint8_t k);