summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/features.txt4
-rw-r--r--apps/keymaps/keymap-creativezv.c1
-rw-r--r--apps/keymaps/keymap-creativezvm.c1
-rw-r--r--apps/keymaps/keymap-e200.c2
-rw-r--r--apps/keymaps/keymap-fuze.c1
-rw-r--r--apps/keymaps/keymap-m200.c1
-rw-r--r--apps/keymaps/keymap-mr500.c1
-rw-r--r--apps/keymaps/keymap-recorder.c1
-rw-r--r--apps/keymaps/keymap-x5.c3
-rw-r--r--apps/lang/english.lang17
-rw-r--r--apps/menus/settings_menu.c9
-rw-r--r--apps/recorder/keyboard.c138
-rw-r--r--apps/settings.h4
-rw-r--r--apps/settings_list.c4
14 files changed, 121 insertions, 66 deletions
diff --git a/apps/features.txt b/apps/features.txt
index 888e9d2210..14204dfb6d 100644
--- a/apps/features.txt
+++ b/apps/features.txt
@@ -102,6 +102,10 @@ masf
102masd 102masd
103#endif 103#endif
104 104
105#if defined(HAVE_MORSE_INPUT)
106morse_input
107#endif
108
105#if defined(HAVE_PITCHSCREEN) 109#if defined(HAVE_PITCHSCREEN)
106pitchscreen 110pitchscreen
107#endif 111#endif
diff --git a/apps/keymaps/keymap-creativezv.c b/apps/keymaps/keymap-creativezv.c
index c75a5b29cd..b88c1409cd 100644
--- a/apps/keymaps/keymap-creativezv.c
+++ b/apps/keymaps/keymap-creativezv.c
@@ -213,6 +213,7 @@ static const struct button_mapping button_context_keyboard[] = {
213 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, 213 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
214 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, 214 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
215 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, 215 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
216 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
216 LAST_ITEM_IN_LIST 217 LAST_ITEM_IN_LIST
217}; /* button_context_keyboard */ 218}; /* button_context_keyboard */
218 219
diff --git a/apps/keymaps/keymap-creativezvm.c b/apps/keymaps/keymap-creativezvm.c
index 12694bc473..b355018892 100644
--- a/apps/keymaps/keymap-creativezvm.c
+++ b/apps/keymaps/keymap-creativezvm.c
@@ -212,6 +212,7 @@ static const struct button_mapping button_context_keyboard[] = {
212 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, 212 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
213 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, 213 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
214 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, 214 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
215 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
215 LAST_ITEM_IN_LIST 216 LAST_ITEM_IN_LIST
216}; /* button_context_keyboard */ 217}; /* button_context_keyboard */
217 218
diff --git a/apps/keymaps/keymap-e200.c b/apps/keymaps/keymap-e200.c
index 487fb11130..2deac631ac 100644
--- a/apps/keymaps/keymap-e200.c
+++ b/apps/keymaps/keymap-e200.c
@@ -265,6 +265,8 @@ static const struct button_mapping button_context_keyboard[] = {
265 { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, 265 { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
266 { ACTION_KBD_DONE, BUTTON_UP, BUTTON_NONE }, 266 { ACTION_KBD_DONE, BUTTON_UP, BUTTON_NONE },
267 { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE }, 267 { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE },
268 { ACTION_KBD_MORSE_INPUT, BUTTON_REC|BUTTON_REL, BUTTON_REC },
269 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
268 270
269 LAST_ITEM_IN_LIST 271 LAST_ITEM_IN_LIST
270}; /* button_context_keyboard */ 272}; /* button_context_keyboard */
diff --git a/apps/keymaps/keymap-fuze.c b/apps/keymaps/keymap-fuze.c
index e44ee518f2..3e89cc595f 100644
--- a/apps/keymaps/keymap-fuze.c
+++ b/apps/keymaps/keymap-fuze.c
@@ -266,6 +266,7 @@ static const struct button_mapping button_context_keyboard[] = {
266 { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, 266 { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
267 { ACTION_KBD_DONE, BUTTON_UP, BUTTON_NONE }, 267 { ACTION_KBD_DONE, BUTTON_UP, BUTTON_NONE },
268 { ACTION_KBD_ABORT, BUTTON_HOME|BUTTON_REPEAT, BUTTON_NONE }, 268 { ACTION_KBD_ABORT, BUTTON_HOME|BUTTON_REPEAT, BUTTON_NONE },
269 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
269 270
270 LAST_ITEM_IN_LIST 271 LAST_ITEM_IN_LIST
271}; /* button_context_keyboard */ 272}; /* button_context_keyboard */
diff --git a/apps/keymaps/keymap-m200.c b/apps/keymaps/keymap-m200.c
index 78a4947b2f..e3aa093a81 100644
--- a/apps/keymaps/keymap-m200.c
+++ b/apps/keymaps/keymap-m200.c
@@ -274,6 +274,7 @@ static const struct button_mapping button_context_keyboard[] = {
274 { ACTION_KBD_DONE, BUTTON_VOL_UP, BUTTON_NONE }, 274 { ACTION_KBD_DONE, BUTTON_VOL_UP, BUTTON_NONE },
275 { ACTION_KBD_DONE, BUTTON_VOL_DOWN, BUTTON_NONE }, 275 { ACTION_KBD_DONE, BUTTON_VOL_DOWN, BUTTON_NONE },
276 { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE }, 276 { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE },
277 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
277 278
278 LAST_ITEM_IN_LIST 279 LAST_ITEM_IN_LIST
279}; /* button_context_keyboard */ 280}; /* button_context_keyboard */
diff --git a/apps/keymaps/keymap-mr500.c b/apps/keymaps/keymap-mr500.c
index 36ffea46de..0b1dc767f2 100644
--- a/apps/keymaps/keymap-mr500.c
+++ b/apps/keymaps/keymap-mr500.c
@@ -191,6 +191,7 @@ static const struct button_mapping button_context_keyboard[] = {
191 { ACTION_KBD_UP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE }, 191 { ACTION_KBD_UP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
192 { ACTION_KBD_DOWN, BUTTON_RC_DOWN, BUTTON_NONE }, 192 { ACTION_KBD_DOWN, BUTTON_RC_DOWN, BUTTON_NONE },
193 { ACTION_KBD_DOWN, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE }, 193 { ACTION_KBD_DOWN, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE },
194 { ACTION_KBD_MORSE_SELECT, BUTTON_RC_HEART|BUTTON_REL, BUTTON_NONE },
194 195
195 LAST_ITEM_IN_LIST 196 LAST_ITEM_IN_LIST
196}; /* button_context_keyboard */ 197}; /* button_context_keyboard */
diff --git a/apps/keymaps/keymap-recorder.c b/apps/keymaps/keymap-recorder.c
index 6c8ae0460e..0ab0e5f8c6 100644
--- a/apps/keymaps/keymap-recorder.c
+++ b/apps/keymaps/keymap-recorder.c
@@ -197,6 +197,7 @@ static const struct button_mapping button_context_keyboard[] = {
197 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, 197 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
198 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, 198 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
199 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, 199 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
200 { ACTION_KBD_MORSE_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
200 201
201 LAST_ITEM_IN_LIST 202 LAST_ITEM_IN_LIST
202}; /* button_context_keyboard */ 203}; /* button_context_keyboard */
diff --git a/apps/keymaps/keymap-x5.c b/apps/keymaps/keymap-x5.c
index 8b94118ac1..69602d7ca7 100644
--- a/apps/keymaps/keymap-x5.c
+++ b/apps/keymaps/keymap-x5.c
@@ -132,9 +132,10 @@ static const struct button_mapping button_context_keyboard[] = {
132 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, 132 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
133 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, 133 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
134 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, 134 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
135 { ACTION_KBD_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, 135 { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
136 { ACTION_KBD_DONE, BUTTON_PLAY, BUTTON_NONE }, 136 { ACTION_KBD_DONE, BUTTON_PLAY, BUTTON_NONE },
137 { ACTION_KBD_ABORT, BUTTON_REC, BUTTON_NONE }, 137 { ACTION_KBD_ABORT, BUTTON_REC, BUTTON_NONE },
138 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
138 139
139 LAST_ITEM_IN_LIST 140 LAST_ITEM_IN_LIST
140}; /* button_context_keyboard */ 141}; /* button_context_keyboard */
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 9fa1f7b7b3..198a3c7358 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -13210,3 +13210,20 @@
13210 *: "Queue Last Shuffled" 13210 *: "Queue Last Shuffled"
13211 </voice> 13211 </voice>
13212</phrase> 13212</phrase>
13213<phrase>
13214 id: LANG_MORSE_INPUT
13215 desc: in Settings -> System
13216 user: core
13217 <source>
13218 *: none
13219 morse_input: "Use Morse Code Input"
13220 </source>
13221 <dest>
13222 *: none
13223 morse_input: "Use Morse Code Input"
13224 </dest>
13225 <voice>
13226 *: none
13227 morse_input: "Use Morse Code Input"
13228 </voice>
13229</phrase>
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index c11bf0eb3d..135e632479 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -257,6 +257,10 @@ MENUITEM_SETTING(usb_hid, &global_settings.usb_hid, NULL);
257MENUITEM_SETTING(usb_keypad_mode, &global_settings.usb_keypad_mode, NULL); 257MENUITEM_SETTING(usb_keypad_mode, &global_settings.usb_keypad_mode, NULL);
258#endif 258#endif
259 259
260#ifdef HAVE_MORSE_INPUT
261MENUITEM_SETTING(morse_input, &global_settings.morse_input, NULL);
262#endif
263
260#ifdef HAVE_BUTTON_LIGHT 264#ifdef HAVE_BUTTON_LIGHT
261MENUITEM_SETTING(buttonlight_timeout, &global_settings.buttonlight_timeout, NULL); 265MENUITEM_SETTING(buttonlight_timeout, &global_settings.buttonlight_timeout, NULL);
262#endif 266#endif
@@ -280,6 +284,9 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
280#endif 284#endif
281 &poweroff, 285 &poweroff,
282 &limits_menu, 286 &limits_menu,
287#ifdef HAVE_MORSE_INPUT
288 &morse_input,
289#endif
283#if CONFIG_CODEC == MAS3507D 290#if CONFIG_CODEC == MAS3507D
284 &line_in, 291 &line_in,
285#endif 292#endif
@@ -287,7 +294,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
287 &car_adapter_mode, 294 &car_adapter_mode,
288#endif 295#endif
289#ifdef IPOD_ACCESSORY_PROTOCOL 296#ifdef IPOD_ACCESSORY_PROTOCOL
290 &serial_bitrate, 297 &serial_bitrate,
291#endif 298#endif
292#ifdef HAVE_ACCESSORY_SUPPLY 299#ifdef HAVE_ACCESSORY_SUPPLY
293 &accessory_supply, 300 &accessory_supply,
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index e6a3c927e3..1e9e8f32ab 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -49,45 +49,47 @@
49#define DEFAULT_MARGIN 6 49#define DEFAULT_MARGIN 6
50#define KBD_BUF_SIZE 500 50#define KBD_BUF_SIZE 500
51 51
52#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ 52#if (CONFIG_KEYPAD == ONDIO_PAD) \
53 (CONFIG_KEYPAD == IRIVER_H300_PAD) 53 || (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
54#define KBD_CURSOR_KEYS /* certain key combos move the cursor even if not 54 || (CONFIG_KEYPAD == IPOD_3G_PAD) \
55 in line edit mode */ 55 || (CONFIG_KEYPAD == IPOD_4G_PAD) \
56#define KBD_MODES /* I-Rivers can use picker, line edit and cursor keys */ 56 || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
57#define KBD_MORSE_INPUT /* I-Rivers have a Morse input mode */ 57 || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
58 58 || (CONFIG_KEYPAD == IAUDIO_M3_PAD) \
59#elif CONFIG_KEYPAD == ONDIO_PAD /* restricted Ondio keypad */ 59 || (CONFIG_KEYPAD == IRIVER_H10_PAD)
60#define KBD_MODES /* Ondio uses 2 modes, picker and line edit */ 60/* no key combos to move the cursor if not in line edit mode */
61 61#define KBD_MODES /* uses 2 modes, picker and line edit */
62#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) \ 62
63 || (CONFIG_KEYPAD == IPOD_4G_PAD) 63#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) \
64#define KBD_MODES /* iPod uses 2 modes, picker and line edit */ 64 || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
65#define KBD_MORSE_INPUT 65 || (CONFIG_KEYPAD == GIGABEAT_PAD) \
66 66 || (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
67#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD 67 || (CONFIG_KEYPAD == SANSA_E200_PAD) \
68#define KBD_MODES /* iFP7xx uses 2 modes, picker and line edit */ 68 || (CONFIG_KEYPAD == SANSA_FUZE_PAD) \
69 69 || (CONFIG_KEYPAD == SANSA_C200_PAD) \
70#elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) || (CONFIG_KEYPAD == IAUDIO_M3_PAD) 70 || (CONFIG_KEYPAD == SAMSUNG_YH_PAD)
71#define KBD_MODES /* iAudios use 2 modes, picker and line edit */ 71/* certain key combos move the cursor even if not in line edit mode */
72
73#elif CONFIG_KEYPAD == IRIVER_H10_PAD
74#define KBD_MODES /* iriver H10 uses 2 modes, picker and line edit */
75#define KBD_MORSE_INPUT
76
77#elif CONFIG_KEYPAD == GIGABEAT_PAD
78#define KBD_CURSOR_KEYS 72#define KBD_CURSOR_KEYS
79#define KBD_MODES 73#define KBD_MODES /* uses 2 modes, picker and line edit */
80#define KBD_MORSE_INPUT
81 74
82#elif CONFIG_KEYPAD == SANSA_E200_PAD \ 75#else
83 || CONFIG_KEYPAD == SANSA_FUZE_PAD \ 76#define KBD_CURSOR_KEYS /* certain keys move the cursor, no line edit mode */
84 || CONFIG_KEYPAD == SANSA_C200_PAD \ 77#endif
85 || CONFIG_KEYPAD == SAMSUNG_YH_PAD
86#define KBD_CURSOR_KEYS
87#define KBD_MODES
88 78
89#elif CONFIG_KEYPAD == MROBE100_PAD 79#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
90#define KBD_MORSE_INPUT 80 || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
81 || (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
82 || (CONFIG_KEYPAD == IPOD_3G_PAD) \
83 || (CONFIG_KEYPAD == IPOD_4G_PAD) \
84 || (CONFIG_KEYPAD == IRIVER_H10_PAD) \
85 || (CONFIG_KEYPAD == GIGABEAT_PAD) \
86 || (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
87 || (CONFIG_KEYPAD == MROBE100_PAD) \
88 || (CONFIG_KEYPAD == SANSA_E200_PAD) \
89 || (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) \
90 || (CONFIG_KEYPAD == PHILIPS_SA9200_PAD)
91/* certain key combos toggle input mode between keyboard input and Morse input */
92#define KBD_TOGGLE_INPUT
91#endif 93#endif
92 94
93struct keyboard_parameters 95struct keyboard_parameters
@@ -124,7 +126,7 @@ struct keyboard_parameters
124static struct keyboard_parameters kbd_param[NB_SCREENS]; 126static struct keyboard_parameters kbd_param[NB_SCREENS];
125static bool kbd_loaded = false; 127static bool kbd_loaded = false;
126 128
127#ifdef KBD_MORSE_INPUT 129#ifdef HAVE_MORSE_INPUT
128/* FIXME: We should put this to a configuration file. */ 130/* FIXME: We should put this to a configuration file. */
129static const char *morse_alphabets = 131static const char *morse_alphabets =
130 "abcdefghijklmnopqrstuvwxyz1234567890,.?-@ "; 132 "abcdefghijklmnopqrstuvwxyz1234567890,.?-@ ";
@@ -134,7 +136,6 @@ static const unsigned char morse_codes[] = {
134 0x2f,0x27,0x23,0x21,0x20,0x30,0x38,0x3c,0x3e,0x3f, 136 0x2f,0x27,0x23,0x21,0x20,0x30,0x38,0x3c,0x3e,0x3f,
135 0x73,0x55,0x4c,0x61,0x5a,0x80 }; 137 0x73,0x55,0x4c,0x61,0x5a,0x80 };
136 138
137static bool morse_mode = false;
138#endif 139#endif
139 140
140/* Loads a custom keyboard into memory 141/* Loads a custom keyboard into memory
@@ -306,7 +307,8 @@ int kbd_input(char* text, int buflen)
306 unsigned char *utf8; 307 unsigned char *utf8;
307 bool cur_blink = true; /* Cursor on/off flag */ 308 bool cur_blink = true; /* Cursor on/off flag */
308 int ret = 0; /* assume success */ 309 int ret = 0; /* assume success */
309#ifdef KBD_MORSE_INPUT 310#ifdef HAVE_MORSE_INPUT
311 bool morse_mode = global_settings.morse_input;
310 bool morse_reading = false; 312 bool morse_reading = false;
311 unsigned char morse_code = 0; 313 unsigned char morse_code = 0;
312 int morse_tick = 0; 314 int morse_tick = 0;
@@ -534,10 +536,10 @@ int kbd_input(char* text, int buflen)
534 pm->main_x = 0; 536 pm->main_x = 0;
535 pm->keyboard_margin -= pm->keyboard_margin/2; 537 pm->keyboard_margin -= pm->keyboard_margin/2;
536 538
537#ifdef KBD_MORSE_INPUT 539#ifdef HAVE_MORSE_INPUT
538 pm->old_main_y = pm->main_y; 540 pm->old_main_y = pm->main_y;
539 if (morse_mode) 541 if (morse_mode)
540 pm->main_y = sc_h - pm->font_h; 542 pm->main_y = sc_h - pm->font_h - BUTTONBAR_HEIGHT;
541#endif 543#endif
542 } 544 }
543 545
@@ -567,7 +569,7 @@ int kbd_input(char* text, int buflen)
567 FOR_NB_SCREENS(l) 569 FOR_NB_SCREENS(l)
568 screens[l].clear_display(); 570 screens[l].clear_display();
569 571
570#ifdef KBD_MORSE_INPUT 572#ifdef HAVE_MORSE_INPUT
571 if (morse_mode) 573 if (morse_mode)
572 { 574 {
573 FOR_NB_SCREENS(l) 575 FOR_NB_SCREENS(l)
@@ -615,7 +617,7 @@ int kbd_input(char* text, int buflen)
615 } 617 }
616 } 618 }
617 else 619 else
618#endif /* KBD_MORSE_INPUT */ 620#endif /* HAVE_MORSE_INPUT */
619 { 621 {
620 /* draw page */ 622 /* draw page */
621 FOR_NB_SCREENS(l) 623 FOR_NB_SCREENS(l)
@@ -752,7 +754,7 @@ int kbd_input(char* text, int buflen)
752 sc->getwidth(), pm->font_h + 2); 754 sc->getwidth(), pm->font_h + 2);
753 else /* highlight the key that has focus */ 755 else /* highlight the key that has focus */
754#endif 756#endif
755#ifdef KBD_MORSE_INPUT 757#ifdef HAVE_MORSE_INPUT
756 if(!morse_mode) 758 if(!morse_mode)
757#endif 759#endif
758 sc->fillrect(pm->font_w*pm->x, 760 sc->fillrect(pm->font_w*pm->x,
@@ -771,14 +773,14 @@ int kbd_input(char* text, int buflen)
771 pm = &param[button_screen]; 773 pm = &param[button_screen];
772 sc = &screens[button_screen]; 774 sc = &screens[button_screen];
773 775
774#if defined(KBD_MODES) || defined(KBD_MORSE_INPUT) 776#if defined(KBD_MODES) || defined(HAVE_MORSE_INPUT)
775 /* Remap some buttons to allow to move 777 /* Remap some buttons to allow to move
776 * cursor in line edit mode and morse mode. */ 778 * cursor in line edit mode and morse mode. */
777#if defined(KBD_MODES) && defined(KBD_MORSE_INPUT) 779#if defined(KBD_MODES) && defined(HAVE_MORSE_INPUT)
778 if (pm->line_edit || morse_mode) 780 if (pm->line_edit || morse_mode)
779#elif defined(KBD_MODES) 781#elif defined(KBD_MODES)
780 if (pm->line_edit) 782 if (pm->line_edit)
781#else /* defined(KBD_MORSE_INPUT) */ 783#else /* defined(HAVE_MORSE_INPUT) */
782 if (morse_mode) 784 if (morse_mode)
783#endif 785#endif
784 { 786 {
@@ -787,7 +789,7 @@ int kbd_input(char* text, int buflen)
787 if (button == ACTION_KBD_RIGHT) 789 if (button == ACTION_KBD_RIGHT)
788 button = ACTION_KBD_CURSOR_RIGHT; 790 button = ACTION_KBD_CURSOR_RIGHT;
789 } 791 }
790#endif /* defined(KBD_MODES) || defined(KBD_MORSE_INPUT) */ 792#endif /* defined(KBD_MODES) || defined(HAVE_MORSE_INPUT) */
791 793
792 switch ( button ) 794 switch ( button )
793 { 795 {
@@ -798,7 +800,7 @@ int kbd_input(char* text, int buflen)
798 800
799 case ACTION_KBD_PAGE_FLIP: 801 case ACTION_KBD_PAGE_FLIP:
800 { 802 {
801#ifdef KBD_MORSE_INPUT 803#ifdef HAVE_MORSE_INPUT
802 if (morse_mode) 804 if (morse_mode)
803 break; 805 break;
804#endif 806#endif
@@ -810,7 +812,7 @@ int kbd_input(char* text, int buflen)
810 break; 812 break;
811 } 813 }
812 814
813#ifdef KBD_MORSE_INPUT 815#if defined(HAVE_MORSE_INPUT) && defined(KBD_TOGGLE_INPUT)
814 case ACTION_KBD_MORSE_INPUT: 816 case ACTION_KBD_MORSE_INPUT:
815 morse_mode = !morse_mode; 817 morse_mode = !morse_mode;
816 818
@@ -822,7 +824,7 @@ int kbd_input(char* text, int buflen)
822 if (morse_mode) 824 if (morse_mode)
823 { 825 {
824 pm->old_main_y = pm->main_y; 826 pm->old_main_y = pm->main_y;
825 pm->main_y = sc->getheight() - pm->font_h; 827 pm->main_y = sc->getheight() - pm->font_h - BUTTONBAR_HEIGHT;
826 } 828 }
827 else 829 else
828 { 830 {
@@ -831,7 +833,7 @@ int kbd_input(char* text, int buflen)
831 } 833 }
832 /* FIXME: We should talk something like Morse mode.. */ 834 /* FIXME: We should talk something like Morse mode.. */
833 break; 835 break;
834#endif /* KBD_MORSE_INPUT */ 836#endif /* KBD_TOGGLE_INPUT */
835 837
836 case ACTION_KBD_RIGHT: 838 case ACTION_KBD_RIGHT:
837 if (++pm->x >= pm->max_chars) 839 if (++pm->x >= pm->max_chars)
@@ -864,7 +866,7 @@ int kbd_input(char* text, int buflen)
864 break; 866 break;
865 867
866 case ACTION_KBD_DOWN: 868 case ACTION_KBD_DOWN:
867#ifdef KBD_MORSE_INPUT 869#ifdef HAVE_MORSE_INPUT
868#ifdef KBD_MODES 870#ifdef KBD_MODES
869 if (morse_mode) 871 if (morse_mode)
870 { 872 {
@@ -877,7 +879,7 @@ int kbd_input(char* text, int buflen)
877 if (morse_mode) 879 if (morse_mode)
878 break; 880 break;
879#endif 881#endif
880#endif /* KBD_MORSE_INPUT */ 882#endif /* HAVE_MORSE_INPUT */
881 { 883 {
882#ifdef KBD_MODES 884#ifdef KBD_MODES
883 if (pm->line_edit) 885 if (pm->line_edit)
@@ -907,7 +909,7 @@ int kbd_input(char* text, int buflen)
907 break; 909 break;
908 910
909 case ACTION_KBD_UP: 911 case ACTION_KBD_UP:
910#ifdef KBD_MORSE_INPUT 912#ifdef HAVE_MORSE_INPUT
911#ifdef KBD_MODES 913#ifdef KBD_MODES
912 if (morse_mode) 914 if (morse_mode)
913 { 915 {
@@ -920,7 +922,7 @@ int kbd_input(char* text, int buflen)
920 if (morse_mode) 922 if (morse_mode)
921 break; 923 break;
922#endif 924#endif
923#endif /* KBD_MORSE_INPUT */ 925#endif /* HAVE_MORSE_INPUT */
924 { 926 {
925#ifdef KBD_MODES 927#ifdef KBD_MODES
926 if (pm->line_edit) 928 if (pm->line_edit)
@@ -955,7 +957,7 @@ int kbd_input(char* text, int buflen)
955 done = true; 957 done = true;
956 break; 958 break;
957 959
958#ifdef KBD_MORSE_INPUT 960#ifdef HAVE_MORSE_INPUT
959 case ACTION_KBD_MORSE_SELECT: 961 case ACTION_KBD_MORSE_SELECT:
960 if (morse_mode && morse_reading) 962 if (morse_mode && morse_reading)
961 { 963 {
@@ -965,10 +967,10 @@ int kbd_input(char* text, int buflen)
965 } 967 }
966 968
967 break; 969 break;
968#endif /* KBD_MORSE_INPUT */ 970#endif /* HAVE_MORSE_INPUT */
969 971
970 case ACTION_KBD_SELECT: 972 case ACTION_KBD_SELECT:
971#ifdef KBD_MORSE_INPUT 973#ifdef HAVE_MORSE_INPUT
972#ifdef KBD_MODES 974#ifdef KBD_MODES
973 if (morse_mode && !pm->line_edit) 975 if (morse_mode && !pm->line_edit)
974#else 976#else
@@ -984,7 +986,7 @@ int kbd_input(char* text, int buflen)
984 } 986 }
985 break; 987 break;
986 } 988 }
987#endif /* KBD_MORSE_INPUT */ 989#endif /* HAVE_MORSE_INPUT */
988 990
989 /* inserts the selected char */ 991 /* inserts the selected char */
990#ifdef KBD_MODES 992#ifdef KBD_MODES
@@ -1088,7 +1090,7 @@ int kbd_input(char* text, int buflen)
1088 /* speak revised text */ 1090 /* speak revised text */
1089 break; 1091 break;
1090 1092
1091#if !defined (KBD_MODES) || defined (KBD_CURSOR_KEYS) 1093#ifdef KBD_CURSOR_KEYS
1092 case ACTION_KBD_BACKSPACE: 1094 case ACTION_KBD_BACKSPACE:
1093 if (pm->hangul) 1095 if (pm->hangul)
1094 { 1096 {
@@ -1114,7 +1116,7 @@ int kbd_input(char* text, int buflen)
1114 if (global_settings.talk_menu) /* voice UI? */ 1116 if (global_settings.talk_menu) /* voice UI? */
1115 talk_spell(text, false); /* speak revised text */ 1117 talk_spell(text, false); /* speak revised text */
1116 break; 1118 break;
1117#endif /* !defined (KBD_MODES) || defined (KBD_CURSOR_KEYS) */ 1119#endif /* KBD_CURSOR_KEYS */
1118 1120
1119 case ACTION_KBD_CURSOR_RIGHT: 1121 case ACTION_KBD_CURSOR_RIGHT:
1120 pm->hangul = false; 1122 pm->hangul = false;
@@ -1145,7 +1147,7 @@ int kbd_input(char* text, int buflen)
1145 break; 1147 break;
1146 1148
1147 case BUTTON_NONE: 1149 case BUTTON_NONE:
1148#ifdef KBD_MORSE_INPUT 1150#ifdef HAVE_MORSE_INPUT
1149 if (morse_reading) 1151 if (morse_reading)
1150 { 1152 {
1151 int j; 1153 int j;
@@ -1172,7 +1174,7 @@ int kbd_input(char* text, int buflen)
1172 if (global_settings.talk_menu) /* voice UI? */ 1174 if (global_settings.talk_menu) /* voice UI? */
1173 talk_spell(text, false); /* speak revised text */ 1175 talk_spell(text, false); /* speak revised text */
1174 } 1176 }
1175#endif /* KBD_MORSE_INPUT */ 1177#endif /* HAVE_MORSE_INPUT */
1176 break; 1178 break;
1177 1179
1178 default: 1180 default:
@@ -1198,6 +1200,14 @@ int kbd_input(char* text, int buflen)
1198 if (ret < 0) 1200 if (ret < 0)
1199 splash(HZ/2, ID2P(LANG_CANCEL)); 1201 splash(HZ/2, ID2P(LANG_CANCEL));
1200 1202
1203#ifdef HAVE_MORSE_INPUT
1204 if(global_settings.morse_input != morse_mode)
1205 {
1206 global_settings.morse_input = morse_mode;
1207 settings_save();
1208 }
1209#endif /* HAVE_MORSE_INPUT */
1210
1201 FOR_NB_SCREENS(l) 1211 FOR_NB_SCREENS(l)
1202 screens[l].setfont(FONT_UI); 1212 screens[l].setfont(FONT_UI);
1203 viewportmanager_set_statusbar(oldbars); 1213 viewportmanager_set_statusbar(oldbars);
diff --git a/apps/settings.h b/apps/settings.h
index 880078885f..eba592aca8 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -798,6 +798,10 @@ struct user_settings
798 int compressor_release_time; 798 int compressor_release_time;
799#endif 799#endif
800 800
801#ifdef HAVE_MORSE_INPUT
802 bool morse_input; /* text input method setting */
803#endif
804
801}; 805};
802 806
803/** global variables **/ 807/** global variables **/
diff --git a/apps/settings_list.c b/apps/settings_list.c
index b0a1a76b3a..9f290e2a18 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -1635,6 +1635,10 @@ const struct settings_list settings[] = {
1635 VIEWPORT_SETTING(remote_ui_vp_config, "remote ui viewport"), 1635 VIEWPORT_SETTING(remote_ui_vp_config, "remote ui viewport"),
1636#endif 1636#endif
1637#endif 1637#endif
1638
1639#ifdef HAVE_MORSE_INPUT
1640 OFFON_SETTING(0, morse_input, LANG_MORSE_INPUT, false, "morse input", NULL),
1641#endif
1638}; 1642};
1639 1643
1640const int nb_settings = sizeof(settings)/sizeof(*settings); 1644const int nb_settings = sizeof(settings)/sizeof(*settings);