2#include "TextElement.hpp"
5#define KEYCODE_COUNT 47
13 EKeyboard(std::function<
void(
char)> typeAction);
20 void just_type(
const char input);
25 const std::string& getTextInput();
26 std::string textInput;
30 std::function<void(
char)> typeAction = NULL;
34 const char* lower_keys =
"`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./";
35 const char* upper_keys =
"~!@#$\%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?";
36 int breaks[4] = { 13, 13, 11, 10 };
41 std::vector<std::string*> rows;
43 const CST_Keycode usbKeys[KEYCODE_COUNT] = {
44 SDLK_BACKQUOTE, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6, SDLK_7, SDLK_8, SDLK_9, SDLK_0, SDLK_MINUS, SDLK_EQUALS,
45 SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y, SDLK_u, SDLK_i, SDLK_o, SDLK_p, SDLK_LEFTBRACKET, SDLK_RIGHTBRACKET, SDLK_BACKSLASH,
46 SDLK_a, SDLK_s, SDLK_d, SDLK_f, SDLK_g, SDLK_h, SDLK_j, SDLK_k, SDLK_l, SDLK_SEMICOLON, SDLK_QUOTE,
47 SDLK_z, SDLK_x, SDLK_c, SDLK_v, SDLK_b, SDLK_n, SDLK_m, SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH
50 inline int rowCount() {
51 return (
int)rows.size();
54 inline int rowLength(
int row) {
55 return (
int)rows[row]->size() / 2;
92 bool hasRoundedKeys =
false;
93 CST_Font* roundKeyFont = NULL;
95 bool touchMode =
false;
96 bool immersiveMode =
false;
99 bool preventEnterAndTab =
false;
100 bool storeOwnText =
false;
102 bool isTouchDrag =
false;
104 void type(
int y,
int x);
105 void generateEKeyboard();
bool process(InputEvents *event)
process any input that is received for this element
void render(Element *parent)
display the current state of the display
Element * parent
the parent element (reference only, not owned)