4 */ |
4 */ |
5 |
5 |
6 #include "config.h" |
6 #include "config.h" |
7 |
7 |
8 |
8 |
9 sButton Buttons[MAXBUTTONS]; // 40 buttons on a screen. |
9 sButton Buttons[MAXBUTTONS]; ///< 40 buttons on a screen. |
10 int level = 1; // Keyboard level. |
10 int level = 1; ///< Keyboard level. |
11 |
11 |
12 extern uint8_t VNC_pointer_button; |
12 extern uint8_t VNC_pointer_button; ///< Mouse buttons mask |
13 extern uint16_t VNC_pointer_x; |
13 extern uint16_t VNC_pointer_x; ///< Mouse coordinate X |
14 extern uint16_t VNC_pointer_y; |
14 extern uint16_t VNC_pointer_y; ///< Mouse coordinate Y |
15 |
15 |
16 //static const char *TAG = "buttons"; |
16 |
17 |
17 #define EDIT_TYPE_TEXT 0 ///< Editor type is text |
18 #define EDIT_TYPE_TEXT 0 |
18 #define EDIT_TYPE_INT 1 ///< Editor type is integer |
19 #define EDIT_TYPE_INT 1 |
19 #define EDIT_TYPE_FLOAT 2 ///< Editor type is float |
20 #define EDIT_TYPE_FLOAT 2 |
|
21 |
20 |
22 |
21 |
23 /***************************************************************************/ |
22 /***************************************************************************/ |
24 |
23 |
25 |
24 |
155 |
154 |
156 static const uint8_t alphalow_tab[] = { 'q','w','e','r','t','y','u','i','o','p', |
155 static const uint8_t alphalow_tab[] = { 'q','w','e','r','t','y','u','i','o','p', |
157 'a','s','d','f','g','h','j','k','l', |
156 'a','s','d','f','g','h','j','k','l', |
158 'z','x','c','v','b','n','m' }; |
157 'z','x','c','v','b','n','m' }; |
159 |
158 |
160 /* Level 1 keys */ |
159 /** |
|
160 * @brief Level 1 keys, lowercase alpha. |
|
161 */ |
161 void B_AlphaLow(void) |
162 void B_AlphaLow(void) |
162 { |
163 { |
163 Buttons_Clear(); |
164 Buttons_Clear(); |
164 |
165 |
165 Buttons_Add( 2, 80,28,36,"q", 0); |
166 Buttons_Add( 2, 80,28,36,"q", 0); |
214 |
215 |
215 static const uint8_t alphacaps_tab[] = { 'Q','W','E','R','T','Y','U','I','O','P', |
216 static const uint8_t alphacaps_tab[] = { 'Q','W','E','R','T','Y','U','I','O','P', |
216 'A','S','D','F','G','H','J','K','L', |
217 'A','S','D','F','G','H','J','K','L', |
217 'Z','X','C','V','B','N','M' }; |
218 'Z','X','C','V','B','N','M' }; |
218 |
219 |
219 /* Level 2 and 3 keys */ |
220 /** |
|
221 * @brief Level 2 and 3 keys, uppercase alpha. |
|
222 */ |
220 void B_AlphaCaps(int level) |
223 void B_AlphaCaps(int level) |
221 { |
224 { |
222 Buttons_Clear(); |
225 Buttons_Clear(); |
223 |
226 |
224 Buttons_Add( 2, 80,28,36,"Q", 0); |
227 Buttons_Add( 2, 80,28,36,"Q", 0); |
276 |
279 |
277 static const uint8_t nums1_tab[] = { '1','2','3','4','5','6','7','8','9','0', |
280 static const uint8_t nums1_tab[] = { '1','2','3','4','5','6','7','8','9','0', |
278 '!','@','#','$','/','^','&','*','(',')', |
281 '!','@','#','$','/','^','&','*','(',')', |
279 '-','\'','\"',':',';',',','?' }; |
282 '-','\'','\"',':',';',',','?' }; |
280 |
283 |
281 /* Level 4 keys */ |
284 /** |
|
285 * @brief Level 4, numeric keys and symbol |
|
286 */ |
282 void B_Nums1(void) |
287 void B_Nums1(void) |
283 { |
288 { |
284 Buttons_Clear(); |
289 Buttons_Clear(); |
285 |
290 |
286 Buttons_Add( 2, 80,28,36,"1", 0); |
291 Buttons_Add( 2, 80,28,36,"1", 0); |
333 |
338 |
334 static const uint8_t nums2_tab[] = { '+','*','/','=','<','>','{','}','[',']', |
339 static const uint8_t nums2_tab[] = { '+','*','/','=','<','>','{','}','[',']', |
335 ' ',' ',' ',' ','%','~','`',' ',' ',' ', |
340 ' ',' ',' ',' ','%','~','`',' ',' ',' ', |
336 '_','\\','|',' ',' ',' ',' ' }; |
341 '_','\\','|',' ',' ',' ',' ' }; |
337 |
342 |
338 /* Level 5 */ |
343 /** |
|
344 * @brief Level 5, symbol keys |
|
345 */ |
339 void B_Nums2(void) |
346 void B_Nums2(void) |
340 { |
347 { |
341 Buttons_Clear(); |
348 Buttons_Clear(); |
342 |
349 |
343 Buttons_Add( 2, 80,28,36,"+", 0); |
350 Buttons_Add( 2, 80,28,36,"+", 0); |
388 } |
395 } |
389 |
396 |
390 |
397 |
391 static const uint8_t digits_tab[] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '+', '-', '.' }; |
398 static const uint8_t digits_tab[] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '+', '-', '.' }; |
392 |
399 |
|
400 /** |
|
401 * @brief A small nummeric keyboard |
|
402 */ |
393 void B_Digits(void) |
403 void B_Digits(void) |
394 { |
404 { |
395 Buttons_Clear(); |
405 Buttons_Clear(); |
396 |
406 |
397 Buttons_Add( 61,200,147,36,"0", 9); |
407 Buttons_Add( 61,200,147,36,"0", 9); |