nds stdio keyboard integration. [詳細]
#include <nds/ndstypes.h>#include <nds/arm9/background.h>構成 | |
| struct | KeyMap |
| defines a key mapping [詳細] | |
| struct | Keyboard |
| describes a keyboard [詳細] | |
型定義 | |
| typedef void(* | KeyChangeCallback )(int key) |
| KeyChangedCallback. | |
| typedef struct KeyMap | KeyMap |
| typedef struct Keyboard | Keyboard |
列挙型 | |
| enum | KeyboardState { Lower = 0, Upper = 1, Numeric = 2, Reduced = 3 } |
states the keyboard can be in, currently only Lower and Upper supported [詳細] | |
関数 | |
| Keyboard * | keyboardGetDefault (void) |
| Gets the default 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 | |
| Keyboard * | keyboardDemoInit (void) |
| initializes the keyboard with default options | |
| void | keyboardShow (void) |
| Displays the keyboard. | |
| void | keyboardHide (void) |
| Hides the 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. | |
| void | keyboardGetString (char *buffer, int maxLen) |
| reads the input until a the return key is pressed or the maxLen is exceeded. | |
| int | keyboardGetChar (void) |
| Waits for user to press a key and returns the key pressed. Use keyboardUpdate instead for async operation. | |
| int | keyboardUpdate (void) |
| Processes the keyboard. Should be called once per frame when using the keyboard in an async manner. | |
nds stdio keyboard integration.
| enum KeyboardState |
| 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.
1.6.3