summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-10-08 07:12:28 +0000
committerJens Arnold <amiconn@rockbox.org>2005-10-08 07:12:28 +0000
commit13fcd6828571d55c196560856e0f71c8024c8dc3 (patch)
tree2017e5efa6849f2710ad4ab716ebca483c33d0f6
parenta0b439c1692434256c23975cd8098c4f5ae6cbdb (diff)
Patch #1316533 by Alexander Spyridakis: All characters on one virtual keyboard page for targets with large LCD.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7597 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/recorder/keyboard.c45
1 files changed, 36 insertions, 9 deletions
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index 6c47c3ad81..0b833c85dc 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -31,16 +31,25 @@
#include "settings.h"
#include "misc.h"
+#define KEYBOARD_MARGIN 3
+
+#if (LCD_WIDTH >= 160) && (LCD_HEIGHT >= 96)
+#define KEYBOARD_LINES 8
+#define KEYBOARD_PAGES 1
+
+#else
#define KEYBOARD_LINES 4
#define KEYBOARD_PAGES 3
-#define KEYBOARD_MARGIN 3
+
+#endif
+
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
(CONFIG_KEYPAD == IRIVER_H300_PAD)
#define KBD_CURSOR_RIGHT (BUTTON_ON | BUTTON_RIGHT)
#define KBD_CURSOR_LEFT (BUTTON_ON | BUTTON_LEFT)
#define KBD_SELECT BUTTON_SELECT
-#define KBD_PAGE_FLIP BUTTON_MODE
+#define KBD_PAGE_FLIP BUTTON_MODE /* unused */
#define KBD_DONE_PRE BUTTON_ON
#define KBD_DONE (BUTTON_ON | BUTTON_REL)
#define KBD_ABORT BUTTON_OFF
@@ -74,10 +83,23 @@
#endif
+#if KEYBOARD_PAGES == 1
+static const char * const kbdpages[KEYBOARD_PAGES][KEYBOARD_LINES] = {
+ { "ABCDEFG abcdefg !?\" @#$%+'",
+ "HIJKLMN hijklmn 789 &_()-`",
+ "OPQRSTU opqrstu 456 §|{}/<",
+ "VWXYZ., vwxyz.,0123 ~=[]*>",
+ "ÀÁÂÃÄÅÆ ÌÍÎÏ ÈÉÊË ¢£¤¥¦§©®",
+ "àáâãäåæ ìíîï èéêë «»°ºª¹²³",
+ "ÓÒÔÕÖØ ÇÐÞÝß ÙÚÛÜ ¯±×÷¡¿µ·",
+ "òóôõöø çðþýÿ ùúûü ¼½¾¬¶¨ " },
+};
+
+#else
static const char * const kbdpages[KEYBOARD_PAGES][KEYBOARD_LINES] = {
{ "ABCDEFG !?\" @#$%+'",
"HIJKLMN 789 &_()-`",
- "OPQRSTU 456 §|{}/<",
+ "OPQRSTU 456 §|{}/<",
"VWXYZ.,0123 ~=[]*>" },
{ "abcdefg ¢£¤¥¦§©®¬",
@@ -91,6 +113,8 @@ static const char * const kbdpages[KEYBOARD_PAGES][KEYBOARD_LINES] = {
"òóôõöø çðþýÿ ùúûü" },
};
+#endif
+
/* helper function to spell a char if voice UI is enabled */
static void kbd_spellchar(char c)
{
@@ -105,9 +129,10 @@ static void kbd_spellchar(char c)
int kbd_input(char* text, int buflen)
{
- bool done = false;
+ bool done = false;
+#if KEYBOARD_PAGES > 1
int page = 0;
-
+#endif
int font_w = 0, font_h = 0, i;
int x = 0, y = 0;
int main_x, main_y, max_chars;
@@ -134,7 +159,7 @@ int kbd_input(char* text, int buflen)
status_y2 = LCD_HEIGHT;
editpos = strlen(text);
-
+
max_chars = LCD_WIDTH / font_w - 2; /* leave room for < and > */
line = kbdpages[0];
@@ -207,7 +232,7 @@ int kbd_input(char* text, int buflen)
return -1;
break;
-#ifdef KBD_PAGE_FLIP
+#if defined(KBD_PAGE_FLIP) && KEYBOARD_PAGES > 1
case KBD_PAGE_FLIP:
if (++page == KEYBOARD_PAGES)
page = 0;
@@ -235,7 +260,8 @@ int kbd_input(char* text, int buflen)
else
{
x = 0;
-#ifndef KBD_PAGE_FLIP /* no dedicated flip key - flip page on wrap */
+#if !defined(KBD_PAGE_FLIP) && KEYBOARD_PAGES > 1
+ /* no dedicated flip key - flip page on wrap */
if (++page == KEYBOARD_PAGES)
page = 0;
line = kbdpages[page];
@@ -263,7 +289,8 @@ int kbd_input(char* text, int buflen)
x--;
else
{
-#ifndef KBD_PAGE_FLIP /* no dedicated flip key - flip page on wrap */
+#if !defined(KBD_PAGE_FLIP) && KEYBOARD_PAGES > 1
+ /* no dedicated flip key - flip page on wrap */
if (--page < 0)
page = (KEYBOARD_PAGES-1);
line = kbdpages[page];