summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/lang/english.lang28
-rw-r--r--apps/recorder/keyboard.c44
2 files changed, 65 insertions, 7 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index abe70b4d9f..f6829e92fa 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -11389,3 +11389,31 @@
11389 lcd_color: "Line Selector Colours" 11389 lcd_color: "Line Selector Colours"
11390 </voice> 11390 </voice>
11391</phrase> 11391</phrase>
11392<phrase>
11393 id: VOICE_EDIT
11394 desc: keyboard
11395 user:
11396 <source>
11397 *: ""
11398 </source>
11399 <dest>
11400 *: ""
11401 </dest>
11402 <voice>
11403 *: "Edit"
11404 </voice>
11405</phrase>
11406<phrase>
11407 id: VOICE_BLANK
11408 desc: keyboard
11409 user:
11410 <source>
11411 *: ""
11412 </source>
11413 <dest>
11414 *: ""
11415 </dest>
11416 <voice>
11417 *: "Blank"
11418 </voice>
11419</phrase>
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index d3658c1bc7..eb49140f8c 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -32,6 +32,8 @@
32#include "hangul.h" 32#include "hangul.h"
33#include "action.h" 33#include "action.h"
34#include "icon.h" 34#include "icon.h"
35#include "pcmbuf.h"
36#include "lang.h"
35 37
36#ifndef O_BINARY 38#ifndef O_BINARY
37#define O_BINARY 0 39#define O_BINARY 0
@@ -188,15 +190,27 @@ int load_kbd(unsigned char* filename)
188/* helper function to spell a char if voice UI is enabled */ 190/* helper function to spell a char if voice UI is enabled */
189static void kbd_spellchar(unsigned short c) 191static void kbd_spellchar(unsigned short c)
190{ 192{
191 static char spell_char[2] = "\0\0"; /* store char to pass to talk_spell */ 193 if (talk_menus_enabled()) /* voice UI? */
192
193 if (talk_menus_enabled() && c < 128) /* voice UI? */
194 { 194 {
195 spell_char[0] = (char)c; 195 unsigned char tmp[5];
196 talk_spell(spell_char, false); 196 /* store char to pass to talk_spell */
197 unsigned char* utf8 = utf8encode(c, tmp);
198 *utf8 = 0;
199
200 if(c == ' ')
201 talk_id(VOICE_BLANK, false);
202 else talk_spell(tmp, false);
197 } 203 }
198} 204}
199 205
206#ifdef KBD_MODES
207static void say_edit(void)
208{
209 if(talk_menus_enabled())
210 talk_id(VOICE_EDIT, false);
211}
212#endif
213
200static void kbd_inschar(unsigned char* text, int buflen, 214static void kbd_inschar(unsigned char* text, int buflen,
201 int* editpos, unsigned short ch) 215 int* editpos, unsigned short ch)
202{ 216{
@@ -814,7 +828,8 @@ int kbd_input(char* text, int buflen)
814 { 828 {
815 int c = utf8seek(text, ++editpos); 829 int c = utf8seek(text, ++editpos);
816 kbd_spellchar(text[c]); 830 kbd_spellchar(text[c]);
817 } 831 } else if(global_settings.beep)
832 pcmbuf_beep(1000, 150, 1500*global_settings.beep);
818 } 833 }
819 else 834 else
820#endif /* KBD_MODES */ 835#endif /* KBD_MODES */
@@ -855,7 +870,8 @@ int kbd_input(char* text, int buflen)
855 { 870 {
856 int c = utf8seek(text, --editpos); 871 int c = utf8seek(text, --editpos);
857 kbd_spellchar(text[c]); 872 kbd_spellchar(text[c]);
858 } 873 } else if(global_settings.beep)
874 pcmbuf_beep(1000, 150, 1500*global_settings.beep);
859 } 875 }
860 else 876 else
861#endif /* KBD_MODES */ 877#endif /* KBD_MODES */
@@ -884,7 +900,11 @@ int kbd_input(char* text, int buflen)
884#ifdef KBD_MORSE_INPUT 900#ifdef KBD_MORSE_INPUT
885#ifdef KBD_MODES 901#ifdef KBD_MODES
886 if (morse_mode) 902 if (morse_mode)
903 {
887 pm->line_edit = !pm->line_edit; 904 pm->line_edit = !pm->line_edit;
905 if(pm->line_edit)
906 say_edit();
907 }
888 else 908 else
889#else 909#else
890 if (morse_mode) 910 if (morse_mode)
@@ -902,7 +922,10 @@ int kbd_input(char* text, int buflen)
902#endif 922#endif
903 if (++pm->y >= pm->lines) 923 if (++pm->y >= pm->lines)
904#ifdef KBD_MODES 924#ifdef KBD_MODES
925 {
905 pm->line_edit = true; 926 pm->line_edit = true;
927 say_edit();
928 }
906#else 929#else
907 pm->y = 0; 930 pm->y = 0;
908#endif 931#endif
@@ -920,7 +943,11 @@ int kbd_input(char* text, int buflen)
920#ifdef KBD_MORSE_INPUT 943#ifdef KBD_MORSE_INPUT
921#ifdef KBD_MODES 944#ifdef KBD_MODES
922 if (morse_mode) 945 if (morse_mode)
946 {
923 pm->line_edit = !pm->line_edit; 947 pm->line_edit = !pm->line_edit;
948 if(pm->line_edit)
949 say_edit();
950 }
924 else 951 else
925#else 952#else
926 if (morse_mode) 953 if (morse_mode)
@@ -938,7 +965,10 @@ int kbd_input(char* text, int buflen)
938#endif 965#endif
939 if (--pm->y < 0) 966 if (--pm->y < 0)
940#ifdef KBD_MODES 967#ifdef KBD_MODES
968 {
941 pm->line_edit = true; 969 pm->line_edit = true;
970 say_edit();
971 }
942#else 972#else
943 pm->y = pm->lines - 1; 973 pm->y = pm->lines - 1;
944#endif 974#endif