libnds
|
nds stdio keyboard integration. More...
Data Structures | |
struct | Keyboard |
describes a keyboard. More... | |
struct | KeyMap |
defines a key mapping. More... | |
Typedefs | |
typedef struct Keyboard | Keyboard |
describes a keyboard. | |
typedef void(* | KeyChangeCallback) (int key) |
callback function pointer for a key changed. | |
typedef struct KeyMap | KeyMap |
defines a key mapping. | |
Enumerations |
Functions | |
Keyboard * | keyboardDemoInit (void) |
initializes the keyboard with default options. Same as calling keyboardInit(NULL, 3, BgType_Text4bpp, BgSize_T_256x512, 20, 0, false, true) More... | |
int | keyboardGetChar (void) |
Waits for user to press a key and returns the key pressed. Use keyboardUpdate instead for async operation. | |
Keyboard * | keyboardGetDefault (void) |
Gets the default keyboard. | |
int | keyboardGetKey (int x, int y) |
returns the ascii code for the key located at the supplied x and y. Will not effect keyboard shift state. More... | |
void | keyboardGetString (char *buffer, int maxLen) |
reads the input until a the return key is pressed or the maxLen is exceeded. More... | |
void | keyboardHide (void) |
Hides the keyboard. | |
Keyboard * | keyboardInit (Keyboard *keyboard, int layer, BgType type, BgSize size, int mapBase, int tileBase, bool mainDisplay, bool loadGraphics) |
initializes the keyboard system with the supplied keyboard More... | |
void | keyboardShow (void) |
Displays the keyboard. | |
int | keyboardUpdate (void) |
Processes the keyboard. Should be called once per frame when using the keyboard in an async manner. More... | |
nds stdio keyboard integration.
enum KeyboardState |
enum Keys |
enum values for the keyboard control keys. negative values are keys with no sensible ascii representation. numbers are chosen to mimic ascii control sequences.
Keyboard* keyboardDemoInit | ( | void | ) |
initializes the keyboard with default options. Same as calling keyboardInit(NULL, 3, BgType_Text4bpp, BgSize_T_256x512, 20, 0, false, true)
int keyboardGetKey | ( | int | x, |
int | y | ||
) |
returns the ascii code for the key located at the supplied x and y. Will not effect keyboard shift state.
x | the pixel x location |
y | the pixel y location |
void keyboardGetString | ( | char * | buffer, |
int | maxLen | ||
) |
reads the input until a the return key is pressed or the maxLen is exceeded.
buffer | a buffer to hold the input string |
maxLen | the maximum length to read |
Keyboard* keyboardInit | ( | Keyboard * | keyboard, |
int | layer, | ||
BgType | type, | ||
BgSize | size, | ||
int | mapBase, | ||
int | tileBase, | ||
bool | mainDisplay, | ||
bool | loadGraphics | ||
) |
initializes the keyboard system with the supplied keyboard
keyboard | the keyboard struct to initialize (can be NULL) |
layer | the background layer to use |
type | the background type to initialize |
size | the background size to initialize |
mapBase | the map base to use for the background |
tileBase | the graphics tile base to use for the background |
mainDisplay | if true the keyboard will render on the main display |
loadGraphics | if true the keyboard graphics will be loaded |
int keyboardUpdate | ( | void | ) |
Processes the keyboard. Should be called once per frame when using the keyboard in an async manner.