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:
parent
57b3395691
commit
3d15f3781a
@ -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);");
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user