Reference.KeyboardPrint History

Hide minor edits - Show changes to output

April 28, 2012, at 12:36 AM by Scott Fitzgerald -
Changed lines 27-28 from:

to:
(:source lang=arduino tabwidth=4:)
void setup() {
// make pin 2 an input and turn on the
// pullup resistor so it goes high unless
// connected to ground:
pinMode(2, INPUT_PULLUP);
Keyboard.begin();
}

void loop() {
//if the button is pressed
if(digitalRead(2)==LOW){
//Send the message
Keyboard.print("Hello!");
}
}
(:sourceend:)
April 28, 2012, at 12:23 AM by Scott Fitzgerald -
April 27, 2012, at 10:43 PM by Scott Fitzgerald -
Changed lines 24-25 from:
int : number of bytes sent\\
\\
to:
int : number of bytes sent

!!!!Example


!!!!See Also
*[[/Reference/KeyboardBegin | Keyboard.begin]]()
*[[/Reference/KeyboardEnd | Keyboard.end]]()
*[[/Reference/KeyboardPress | Keyboard.press]]()
*[[/Reference/KeyboardPrintln | Keyboard.println]]()
*[[/Reference/KeyboardRelease | Keyboard.release]]()
*[[/Reference/KeyboardReleaseAll | Keyboard.releaseAll]]()
*[[/Reference/KeyboardWrite | Keyboard.write]]()
March 28, 2012, at 09:10 PM by Scott Fitzgerald -
March 28, 2012, at 09:09 PM by Scott Fitzgerald -
Added lines 9-10:
Keyboard.print() must be called after initiating [[/Reference/KeyboardBegin | Keyboard.begin]]().
November 30, 2011, at 05:56 AM by Scott Fitzgerald -
Changed lines 7-8 from:
Sends a keystroke to a connected computer.
to:
Sends a keystroke to a connected computer.
Changed line 12 from:
Keyboard.print(character)
to:
Keyboard.print(character)\\
Changed line 22 from:
int : number of bytes sent
to:
int : number of bytes sent\\
November 30, 2011, at 04:56 AM by Scott Fitzgerald -
Added line 23:
\\
November 30, 2011, at 04:54 AM by Scott Fitzgerald -
Added lines 1-22:
[[Reference/MouseKeyboard | Keyboard]]

!!Keyboard.print()

!!!!Description

Sends a keystroke to a connected computer.

WARNING: When you use the Keyboard.print() command, the Arduino takes over your keyboard! Make sure you have control before you use the command. A pushbutton to toggle the keyboard control state is effective.

!!!!Syntax
Keyboard.print(character)
Keyboard.print(characters)

!!!!Parameters

character : a char or int to be sent to the computer as a keystroke
characters : a string to be sent to the computer as a keystroke

!!!!Returns

int : number of bytes sent

Share