diff --git a/ChangeLog b/ChangeLog index 76ee897..8c1eab4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ Version 0.0.2: name changed to spOSMroute, since on there had been another OSMroute already. ============================================================================= +(2013-06-17): +- fixed: softkeyboard is working now with utf8. + (2013-06-16): - fixed: searching for citys is back working again and this time it seems working fine. diff --git a/gui/gui.h b/gui/gui.h index a8a3305..b3acd85 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -157,7 +157,7 @@ struct _GUISoftkeyboard_ { int mode; int enabled; int linepos[2][4]; /* y positions of lines */ - int btnpos[2][4]; /* holds position keys: Shift, Symbols, Space, Close */ + int btnpos[2][7]; /* holds position keys: Left, Right, Shift, Symbols, Space, Del, Close */ iPoint offset; /* screenoffset .. will be set during last draw */ struct image *screen; int last_col; diff --git a/gui/gui_softkeyboard.c b/gui/gui_softkeyboard.c index 2842300..4a110c0 100644 --- a/gui/gui_softkeyboard.c +++ b/gui/gui_softkeyboard.c @@ -1,4 +1,4 @@ -/* $Id: gui_softkeyboard.c,v 1.8 2013/06/17 20:13:37 steffen Exp $ */ +/* $Id: gui_softkeyboard.c,v 1.9 2013/06/17 20:42:58 steffen Exp $ */ /*************************************************************************** * gui_softkeyboard.c * @@ -80,8 +80,8 @@ void gui_softkeyb_show (int enable) { /* only preparing the screen image... copying to the screen will be done later... */ static float _linepos[2][4] = { { 5.0, 25.0, 45.0, 65.0 }, { 20.0, 40.0, 60.0, 95.0 } }; -static float _btnpos[2][5] = { { 2.0, 16.0, 35.0, 62.0, 79.0 }, - { 14.0, 33.0, 60.0, 77.0, 98.0 } }; +static float _btnpos[2][7] = { { 2.0, 6.0, 12.0, 20.0, 32.0, 70.0, 80.0 }, + { 6.0, 10.0, 18.0, 30.0, 68.0, 78.0, 98.0 } }; void gui_softkeyb_getpos (int row, int btnnr, int *x1, int *y1, int *x2, int *y2) { if (row < 3) { @@ -130,31 +130,37 @@ void gui_softkeyb_draw () { if (softkeyb->last_col == i && softkeyb->last_line == j) draw_fillrectangle (softkeyb->screen, x1, y1, x2, y2, &color[COLOR_white][0]); draw_rectangle (softkeyb->screen, x1, y1, x2, y2, ls); - u8_encode (&c, softkeyb->keys[softkeyb->mode][j][i]); + u8_encode (c, softkeyb->keys[softkeyb->mode][j][i]); gfx_draw_text (softkeyb->screen, x1+(x2-x1-12)/2, y1+(y2-y1-12)/2, c, &color[COLOR_white][3]); } } /* draw the last keys */ - for (j = 3, i = 0; i < 5; i++) { + for (j = 3, i = 0; i < 7; i++) { gui_softkeyb_getpos (j, i, &x1, &y1, &x2, &y2); if (softkeyb->last_col == i && softkeyb->last_line == 3) draw_fillrectangle (softkeyb->screen, x1, y1, x2, y2, &color[COLOR_white][0]); draw_rectangle (softkeyb->screen, x1, y1, x2, y2, ls); switch (i) { case (0): - snprintf (c, 16, _("SYM")); + snprintf (c, 16, _("<")); break; case (1): - snprintf (c, 16, _("SHIFT")); + snprintf (c, 16, _(">")); break; case (2): - snprintf (c, 16, _(" ")); + snprintf (c, 16, _("SYM")); break; case (3): - snprintf (c, 16, _("Del")); + snprintf (c, 16, _("SHIFT")); break; case (4): + snprintf (c, 16, _(" ")); + break; + case (5): + snprintf (c, 16, _("Del")); + break; + case (6): snprintf (c, 16, _("Close")); break; } @@ -196,7 +202,7 @@ int gui_softkeyb_event (GUIEvent *event) { } } - for (i = 0; i < 5; i++) { + for (i = 0; i < 7; i++) { gui_softkeyb_getpos (3, i, &x1, &y1, &x2, &y2); if (x1 <= mp.x && mp.x <= x2 && y1 <= mp.y && mp.y <= y2) { if (event->event == EGUI_MOUSEPRESSED) { @@ -204,28 +210,46 @@ int gui_softkeyb_event (GUIEvent *event) { softkeyb->last_col = i; switch (i) { case (0): - softkeyb->mode = (softkeyb->mode == GUI_SOFTKEYB_MODE_SYMBOL) ? 0 : GUI_SOFTKEYB_MODE_SYMBOL; + newevent.key = GUIKEY_LEFT; + newevent.keychar = 0x0; + newevent.event = EGUI_KEYCHAR; + newevent.guiwin_mpos.x = newevent.scr_mpos.x = -1; + newevent.guiwin_mpos.y = newevent.scr_mpos.y = -1; + gui_entry_event (currentwin->focus, &newevent); break; case (1): - softkeyb->mode = (softkeyb->mode == GUI_SOFTKEYB_MODE_SHIFT) ? 0 : GUI_SOFTKEYB_MODE_SHIFT; + newevent.key = GUIKEY_RIGHT; + newevent.keychar = 0x0; + newevent.event = EGUI_KEYCHAR; + newevent.guiwin_mpos.x = newevent.scr_mpos.x = -1; + newevent.guiwin_mpos.y = newevent.scr_mpos.y = -1; + gui_entry_event (currentwin->focus, &newevent); break; case (2): -// newevent.keyval = ' '; + softkeyb->mode = (softkeyb->mode == GUI_SOFTKEYB_MODE_SYMBOL) ? 0 : GUI_SOFTKEYB_MODE_SYMBOL; + break; + case (3): + softkeyb->mode = (softkeyb->mode == GUI_SOFTKEYB_MODE_SHIFT) ? 0 : GUI_SOFTKEYB_MODE_SHIFT; + break; + case (4): + newevent.key = ' '; + newevent.keychar = u8_decode (" ", NULL); newevent.event = EGUI_KEYCHAR; newevent.guiwin_mpos.x = newevent.scr_mpos.x = -1; newevent.guiwin_mpos.y = newevent.scr_mpos.y = -1; gui_entry_event (currentwin->focus, &newevent); return 1; break; - case (3): -// newevent.keyval = 0x08; + case (5): + newevent.key = 0x08; + newevent.keychar = 0x0; newevent.event = EGUI_KEYCHAR; newevent.guiwin_mpos.x = newevent.scr_mpos.x = -1; newevent.guiwin_mpos.y = newevent.scr_mpos.y = -1; gui_entry_event (currentwin->focus, &newevent); return 1; break; - case (4): + case (6): softkeyb->enabled = 0; currentwin->screen_changed = 1; draw ();