summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/zxbox')
-rw-r--r--apps/plugins/zxbox/zxbox_keyb.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c
index 9a55475d3f..5680a8e327 100644
--- a/apps/plugins/zxbox/zxbox_keyb.c
+++ b/apps/plugins/zxbox/zxbox_keyb.c
@@ -1,5 +1,7 @@
1#include "zxconfig.h" 1#include "zxconfig.h"
2 2
3//#define ZX_WRITE_OUT_TEXT
4
3#ifndef O_BINARY 5#ifndef O_BINARY
4#define O_BINARY 0 6#define O_BINARY 0
5#endif 7#endif
@@ -274,8 +276,9 @@ int zx_kbd_input(char* text/*, int buflen*/)
274 bool done = false; 276 bool done = false;
275 int i, j, k, w, l; 277 int i, j, k, w, l;
276 int text_w = 0; 278 int text_w = 0;
277 int len_utf8/*, c = 0*/; 279#ifdef ZX_WRITE_OUT_TEXT
278 int editpos; 280 int editpos, len_utf8;
281#endif
279/* int statusbar_size = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;*/ 282/* int statusbar_size = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;*/
280 unsigned short ch/*, tmp, hlead = 0, hvowel = 0, htail = 0*/; 283 unsigned short ch/*, tmp, hlead = 0, hvowel = 0, htail = 0*/;
281 /*bool hangul = false;*/ 284 /*bool hangul = false;*/
@@ -298,7 +301,7 @@ int zx_kbd_input(char* text/*, int buflen*/)
298 } 301 }
299 302
300 char outline[256]; 303 char outline[256];
301 int button, lastbutton = 0; 304 int button;
302 FOR_NB_SCREENS(l) 305 FOR_NB_SCREENS(l)
303 { 306 {
304 /* Copy default keyboard to buffer */ 307 /* Copy default keyboard to buffer */
@@ -419,13 +422,15 @@ int zx_kbd_input(char* text/*, int buflen*/)
419 param[l].keyboard_margin -= param[l].keyboard_margin/2; 422 param[l].keyboard_margin -= param[l].keyboard_margin/2;
420 423
421 } 424 }
425#ifdef ZX_WRITE_OUT_TEXT
422 editpos = rb->utf8length(text); 426 editpos = rb->utf8length(text);
423 427#endif
424
425 428
426 while(!done) 429 while(!done)
427 { 430 {
431#ifdef ZX_WRITE_OUT_TEXT
428 len_utf8 = rb->utf8length(text); 432 len_utf8 = rb->utf8length(text);
433#endif
429 FOR_NB_SCREENS(l) 434 FOR_NB_SCREENS(l)
430 rb->screens[l]->clear_display(); 435 rb->screens[l]->clear_display();
431 436
@@ -456,8 +461,8 @@ int zx_kbd_input(char* text/*, int buflen*/)
456 param[l].main_y - param[l].keyboard_margin); 461 param[l].main_y - param[l].keyboard_margin);
457 462
458 /* write out the text */ 463 /* write out the text */
459#if 0 464#ifdef ZX_WRITE_OUT_TEXT
460 rb->screens[l]->setfont(param[l].curfont); 465 rb->screens[l]->setfont(param[l].curfont);
461 466
462 i=j=0; 467 i=j=0;
463 param[l].curpos = MIN(editpos, param[l].max_chars_text 468 param[l].curpos = MIN(editpos, param[l].max_chars_text
@@ -493,7 +498,7 @@ int zx_kbd_input(char* text/*, int buflen*/)
493 rb->screens[l]->hline(param[l].curpos*text_w, (param[l].curpos+1)*text_w, 498 rb->screens[l]->hline(param[l].curpos*text_w, (param[l].curpos+1)*text_w,
494 param[l].main_y+param[l].font_h-1); 499 param[l].main_y+param[l].font_h-1);
495#endif 500#endif
496 } 501 }
497 cur_blink = !cur_blink; 502 cur_blink = !cur_blink;
498 503
499 504
@@ -626,7 +631,6 @@ int zx_kbd_input(char* text/*, int buflen*/)
626 } 631 }
627 if (button != BUTTON_NONE) 632 if (button != BUTTON_NONE)
628 { 633 {
629 lastbutton = button;
630 cur_blink = true; 634 cur_blink = true;
631 } 635 }
632 } 636 }