Difference between revisions of "Gb.keyboard"

From Gamebuino Wiki
Jump to: navigation, search
m (Changed title depth)
m (Example: added name in begin())
Line 23: Line 23:
  
 
void setup(){
 
void setup(){
   gb.begin();
+
   gb.begin(F("Keyword example"));
 
   gb.keyboard(text, 12);
 
   gb.keyboard(text, 12);
 
}
 
}

Revision as of 2014-05-18T17:06:21


Description

Displays a keyboard for the user to input some text.

Syntax

gb.keyboard(string, length);

Parameters

  • string (char*): the string that will receive the text written by the user.
  • length (byte): the maximum length of the text the user can input.

Returns

none

Example

#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;

char text[13] = "Default text";

void setup(){
  gb.begin(F("Keyword example"));
  gb.keyboard(text, 12);
}

void loop(){
  if(gb.update()){
    gb.display.println(F("You wrote:"));
    gb.display.println(text);
  }
}

See also