From 8a71f1adfdb2612c5cf347b2fba05d60df144c1f Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Thu, 4 Jan 2007 14:36:04 +0000 Subject: Enable Morse mode for virtual keyboard on h10 players and make it possible to enter line edit while in Morse mode. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11911 a1c6a512-1295-4272-9138-f99709370657 --- apps/keymaps/keymap-h10.c | 7 +++++-- apps/recorder/keyboard.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/keymaps/keymap-h10.c b/apps/keymaps/keymap-h10.c index 16c8c49258..904b8c0bbe 100644 --- a/apps/keymaps/keymap-h10.c +++ b/apps/keymaps/keymap-h10.c @@ -5,6 +5,7 @@ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ + * $Id$ * * Copyright (C) Barry Wardell 2006 * @@ -280,13 +281,15 @@ static const struct button_mapping button_context_keyboard[] = { { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, - { ACTION_KBD_SELECT, BUTTON_REW|BUTTON_REL, BUTTON_REW }, - { ACTION_KBD_DONE, BUTTON_PLAY, BUTTON_NONE }, + { ACTION_KBD_SELECT, BUTTON_REW, BUTTON_NONE }, + { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, { ACTION_KBD_ABORT, BUTTON_FF, BUTTON_NONE }, { ACTION_KBD_UP, BUTTON_SCROLL_UP, BUTTON_NONE }, { ACTION_KBD_UP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_KBD_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE }, { ACTION_KBD_DOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_MORSE_INPUT, BUTTON_REW|BUTTON_PLAY, BUTTON_NONE }, + { ACTION_KBD_MORSE_SELECT, BUTTON_REW|BUTTON_REL, BUTTON_NONE }, LAST_ITEM_IN_LIST }; /* button_context_keyboard */ diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index 8e006117c8..9b4240b8ba 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c @@ -64,6 +64,7 @@ #elif CONFIG_KEYPAD == IRIVER_H10_PAD #define KBD_MODES /* iriver H10 uses 2 modes, picker and line edit */ +#define KBD_MORSE_INPUT #endif struct keyboard_parameters { @@ -708,7 +709,7 @@ int kbd_input(char* text, int buflen) break; case ACTION_KBD_DOWN: -#ifdef KBD_MORSE_INPUT +#if defined KBD_MORSE_INPUT && !defined KBD_MODES if (morse_mode) break; #endif @@ -746,7 +747,7 @@ int kbd_input(char* text, int buflen) break; case ACTION_KBD_UP: -#ifdef KBD_MORSE_INPUT +#if defined KBD_MORSE_INPUT && !defined KBD_MODES if (morse_mode) break; #endif @@ -762,8 +763,13 @@ int kbd_input(char* text, int buflen) #endif FOR_NB_SCREENS(l) { +#ifdef KBD_MORSE_INPUT + if (param[l].y && !morse_mode) +#else if (param[l].y) +#endif param[l].y--; + else #ifndef KBD_MODES param[l].y = param[l].lines - 1;} @@ -807,7 +813,11 @@ int kbd_input(char* text, int buflen) else char_screen = 0; #ifdef KBD_MORSE_INPUT +#ifdef KBD_MODES + if (morse_mode && !line_edit) +#else if (morse_mode) +#endif { morse_tick = current_tick; if (!morse_reading) -- cgit v1.2.3