summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/action.h1
-rw-r--r--apps/keymaps/keymap-h1x0_h3x0.c4
-rw-r--r--apps/recorder/keyboard.c106
3 files changed, 29 insertions, 82 deletions
diff --git a/apps/action.h b/apps/action.h
index 0738b114da..ea15b536a7 100644
--- a/apps/action.h
+++ b/apps/action.h
@@ -227,7 +227,6 @@ enum {
ACTION_KBD_CURSOR_LEFT,
ACTION_KBD_CURSOR_RIGHT,
ACTION_KBD_SELECT,
- ACTION_KBD_SELECT_REM,
ACTION_KBD_PAGE_FLIP,
ACTION_KBD_DONE,
ACTION_KBD_ABORT,
diff --git a/apps/keymaps/keymap-h1x0_h3x0.c b/apps/keymaps/keymap-h1x0_h3x0.c
index 4e13c7a734..62cd940460 100644
--- a/apps/keymaps/keymap-h1x0_h3x0.c
+++ b/apps/keymaps/keymap-h1x0_h3x0.c
@@ -643,7 +643,7 @@ static const struct button_mapping button_context_keyboard_h100remote[] = {
{ ACTION_KBD_CURSOR_LEFT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE },
{ ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_SELECT_REM, BUTTON_RC_MENU, BUTTON_NONE },
+ { ACTION_KBD_SELECT, BUTTON_RC_MENU, BUTTON_NONE },
{ ACTION_KBD_PAGE_FLIP, BUTTON_RC_MODE, BUTTON_NONE },
{ ACTION_KBD_DONE, BUTTON_RC_ON|BUTTON_REL, BUTTON_RC_ON },
{ ACTION_KBD_ABORT, BUTTON_RC_STOP, BUTTON_NONE },
@@ -668,7 +668,7 @@ static const struct button_mapping button_context_keyboard_h300lcdremote[] = {
{ ACTION_KBD_CURSOR_LEFT, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_BITRATE, BUTTON_NONE },
{ ACTION_KBD_CURSOR_RIGHT, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_SELECT_REM, BUTTON_RC_MENU, BUTTON_NONE },
+ { ACTION_KBD_SELECT, BUTTON_RC_MENU, BUTTON_NONE },
{ ACTION_KBD_PAGE_FLIP, BUTTON_RC_MODE, BUTTON_NONE },
{ ACTION_KBD_DONE, BUTTON_RC_ON, BUTTON_NONE },
{ ACTION_KBD_ABORT, BUTTON_RC_STOP, BUTTON_NONE },
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index f2f5d28508..e6a3c927e3 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -771,16 +771,23 @@ int kbd_input(char* text, int buflen)
pm = &param[button_screen];
sc = &screens[button_screen];
-#if defined KBD_MORSE_INPUT && !defined KBD_MODES
+#if defined(KBD_MODES) || defined(KBD_MORSE_INPUT)
+ /* Remap some buttons to allow to move
+ * cursor in line edit mode and morse mode. */
+#if defined(KBD_MODES) && defined(KBD_MORSE_INPUT)
+ if (pm->line_edit || morse_mode)
+#elif defined(KBD_MODES)
+ if (pm->line_edit)
+#else /* defined(KBD_MORSE_INPUT) */
if (morse_mode)
+#endif
{
- /* Remap some buttons for morse mode. */
if (button == ACTION_KBD_LEFT)
button = ACTION_KBD_CURSOR_LEFT;
if (button == ACTION_KBD_RIGHT)
button = ACTION_KBD_CURSOR_RIGHT;
}
-#endif
+#endif /* defined(KBD_MODES) || defined(KBD_MORSE_INPUT) */
switch ( button )
{
@@ -827,91 +834,33 @@ int kbd_input(char* text, int buflen)
#endif /* KBD_MORSE_INPUT */
case ACTION_KBD_RIGHT:
-#ifdef KBD_MODES
-#ifdef KBD_MORSE_INPUT
- /* allow cursor change in non line edit morse mode */
- if (pm->line_edit || morse_mode)
-#else
- /* right doubles as cursor_right in line_edit */
- if (pm->line_edit)
-#endif
+ if (++pm->x >= pm->max_chars)
{
- pm->hangul = false;
-
- if (editpos < len_utf8)
- {
- int c = utf8seek(text, ++editpos);
- kbd_spellchar(text[c]);
- }
-#if CONFIG_CODEC == SWCODEC
- else if (global_settings.talk_menu)
- pcmbuf_beep(1000, 150, 1500);
-#endif
- }
- else
-#endif /* KBD_MODES */
- {
-#ifdef KBD_MORSE_INPUT
- if (morse_mode)
- break;
-#endif
- if (++pm->x >= pm->max_chars)
- {
#ifndef KBD_PAGE_FLIP
- /* no dedicated flip key - flip page on wrap */
- if (++pm->page >= pm->pages)
- pm->page = 0;
+ /* no dedicated flip key - flip page on wrap */
+ if (++pm->page >= pm->pages)
+ pm->page = 0;
#endif
- pm->x = 0;
- }
-
- ch = get_kbd_ch(pm);
- kbd_spellchar(ch);
+ pm->x = 0;
}
+
+ ch = get_kbd_ch(pm);
+ kbd_spellchar(ch);
break;
case ACTION_KBD_LEFT:
-#ifdef KBD_MODES
-#ifdef KBD_MORSE_INPUT
- /* allow cursor change in non line edit morse mode */
- if (pm->line_edit || morse_mode)
-#else
- /* left doubles as cursor_left in line_edit */
- if (pm->line_edit)
-#endif
- {
- pm->hangul = false;
-
- if (editpos > 0)
- {
- int c = utf8seek(text, --editpos);
- kbd_spellchar(text[c]);
- }
-#if CONFIG_CODEC == SWCODEC
- else if (global_settings.talk_menu)
- pcmbuf_beep(1000, 150, 1500);
-#endif
- }
- else
-#endif /* KBD_MODES */
+ if (--pm->x < 0)
{
-#ifdef KBD_MORSE_INPUT
- if (morse_mode)
- break;
-#endif
- if (--pm->x < 0)
- {
#ifndef KBD_PAGE_FLIP
- /* no dedicated flip key - flip page on wrap */
- if (--pm->page < 0)
- pm->page = pm->pages - 1;
+ /* no dedicated flip key - flip page on wrap */
+ if (--pm->page < 0)
+ pm->page = pm->pages - 1;
#endif
- pm->x = pm->max_chars - 1;
- }
-
- ch = get_kbd_ch(pm);
- kbd_spellchar(ch);
+ pm->x = pm->max_chars - 1;
}
+
+ ch = get_kbd_ch(pm);
+ kbd_spellchar(ch);
break;
case ACTION_KBD_DOWN:
@@ -1019,7 +968,6 @@ int kbd_input(char* text, int buflen)
#endif /* KBD_MORSE_INPUT */
case ACTION_KBD_SELECT:
- case ACTION_KBD_SELECT_REM:
#ifdef KBD_MORSE_INPUT
#ifdef KBD_MODES
if (morse_mode && !pm->line_edit)
@@ -1166,6 +1114,7 @@ int kbd_input(char* text, int buflen)
if (global_settings.talk_menu) /* voice UI? */
talk_spell(text, false); /* speak revised text */
break;
+#endif /* !defined (KBD_MODES) || defined (KBD_CURSOR_KEYS) */
case ACTION_KBD_CURSOR_RIGHT:
pm->hangul = false;
@@ -1194,7 +1143,6 @@ int kbd_input(char* text, int buflen)
pcmbuf_beep(1000, 150, 1500);
#endif
break;
-#endif /* !defined (KBD_MODES) || defined (KBD_CURSOR_KEYS) */
case BUTTON_NONE:
#ifdef KBD_MORSE_INPUT