diff options
author | William Wilgus <wilgus.william@gmail.com> | 2020-07-21 02:33:53 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2020-07-22 06:48:28 -0400 |
commit | cb94b3ae2ee7a66845895e2c704cdf62ee74ba13 (patch) | |
tree | 0b2da61e3d513fdc37d18f075b6c079e85165781 /apps/plugins | |
parent | a5df94beb5cd7fd87828b9532b4a1a4da13ef774 (diff) | |
download | rockbox-cb94b3ae2ee7a66845895e2c704cdf62ee74ba13.tar.gz rockbox-cb94b3ae2ee7a66845895e2c704cdf62ee74ba13.zip |
keyboard add ability to specify temporary custom layouts
rb core allows you to load custom keyboard layouts
this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout
use like so:
unsigned short kbd[64];
unsigned short *kbd_p = kbd;
if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
kbd_p = NULL;
rb->kbd_input(buf,sizeof(buf), kbd_p);
Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/calendar.c | 4 | ||||
-rw-r--r-- | apps/plugins/dict.c | 2 | ||||
-rw-r--r-- | apps/plugins/frotz/frotz.c | 4 | ||||
-rw-r--r-- | apps/plugins/goban/goban.c | 6 | ||||
-rw-r--r-- | apps/plugins/keybox.c | 18 | ||||
-rw-r--r-- | apps/plugins/lib/SOURCES | 2 | ||||
-rw-r--r-- | apps/plugins/lib/kbd_helper.c | 63 | ||||
-rw-r--r-- | apps/plugins/lib/kbd_helper.h | 27 | ||||
-rw-r--r-- | apps/plugins/lrcplayer.c | 2 | ||||
-rw-r--r-- | apps/plugins/lua/rocklib.c | 2 | ||||
-rw-r--r-- | apps/plugins/otp.c | 19 | ||||
-rw-r--r-- | apps/plugins/puzzles/rockbox.c | 2 | ||||
-rw-r--r-- | apps/plugins/resistor.c | 6 | ||||
-rw-r--r-- | apps/plugins/rockboy/menu.c | 2 | ||||
-rw-r--r-- | apps/plugins/rockpaint.c | 4 | ||||
-rw-r--r-- | apps/plugins/sdl/progs/duke3d/Game/src/console.c | 2 | ||||
-rw-r--r-- | apps/plugins/sdl/progs/quake/keys.c | 2 | ||||
-rw-r--r-- | apps/plugins/search.c | 2 | ||||
-rw-r--r-- | apps/plugins/sokoban.c | 2 | ||||
-rw-r--r-- | apps/plugins/splitedit.c | 4 | ||||
-rw-r--r-- | apps/plugins/sudoku/sudoku.c | 2 | ||||
-rw-r--r-- | apps/plugins/superdom.c | 2 | ||||
-rw-r--r-- | apps/plugins/text_editor.c | 10 | ||||
-rw-r--r-- | apps/plugins/zxbox/snapshot.c | 2 |
24 files changed, 142 insertions, 49 deletions
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index ded0a70d26..11a37191af 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c @@ -842,7 +842,7 @@ static void add_memo(struct shown *shown, int type) { bool saved = false; struct memo *memo = &memos[memos_in_memory]; - if (rb->kbd_input(memo->message, MAX_CHAR_MEMO_LEN) == 0) + if (rb->kbd_input(memo->message, MAX_CHAR_MEMO_LEN, NULL) == 0) { if (memo->message[0]) { @@ -920,7 +920,7 @@ static bool edit_memo(int change, struct shown *shown) case 1: /* edit */ if(rb->kbd_input(memos[change].message, - MAX_CHAR_MEMO_LEN) == 0) + MAX_CHAR_MEMO_LEN, NULL) == 0) save_memo(change, true, shown); return false; diff --git a/apps/plugins/dict.c b/apps/plugins/dict.c index 9438c1d022..c7868c09d0 100644 --- a/apps/plugins/dict.c +++ b/apps/plugins/dict.c @@ -92,7 +92,7 @@ enum plugin_status plugin_start(const void* parameter) searchword[0] = '\0'; /* get the word to search */ - if (rb->kbd_input(searchword, sizeof(searchword)) < 0) + if (rb->kbd_input(searchword, sizeof(searchword), NULL) < 0) return PLUGIN_OK; /* input cancelled */ fIndex = rb->open(DICT_INDEX, O_RDONLY); /* index file */ diff --git a/apps/plugins/frotz/frotz.c b/apps/plugins/frotz/frotz.c index 6dd6098e0b..4c12cfcd10 100644 --- a/apps/plugins/frotz/frotz.c +++ b/apps/plugins/frotz/frotz.c @@ -195,7 +195,7 @@ zchar os_read_key(int timeout, bool show_cursor) return zkey; inputbuf[0] = '\0'; - r = rb->kbd_input(inputbuf, 5); + r = rb->kbd_input(inputbuf, 5, NULL); rb->lcd_setfont(FONT_SYSFIXED); dumb_dump_screen(); if (!r) @@ -226,7 +226,7 @@ zchar os_read_line(int max, zchar *buf, int timeout, int width, int continued) if (max > width) max = width; strcpy(inputbuf, buf); - r = rb->kbd_input(inputbuf, 256); + r = rb->kbd_input(inputbuf, 256, NULL); rb->lcd_setfont(FONT_SYSFIXED); dumb_dump_screen(); if (!r) diff --git a/apps/plugins/goban/goban.c b/apps/plugins/goban/goban.c index c20724ed70..7b378eebff 100644 --- a/apps/plugins/goban/goban.c +++ b/apps/plugins/goban/goban.c @@ -677,7 +677,7 @@ do_main_menu (void) case MAIN_SAVE_AS: rb->strcpy (new_save_file, save_file); - if (!rb->kbd_input (new_save_file, SAVE_FILE_LENGTH)) + if (!rb->kbd_input(new_save_file, SAVE_FILE_LENGTH, NULL)) { break; } @@ -921,7 +921,7 @@ do_gameinfo_menu (void) break; } - rb->kbd_input (gameinfo_string, gameinfo_string_size); + rb->kbd_input(gameinfo_string, gameinfo_string_size, NULL); sanitize_string (gameinfo_string); set_game_modified(); break; @@ -1191,7 +1191,7 @@ do_comment_edit (void) return false; } - if (!rb->kbd_input (cbuffer, sizeof (cbuffer))) + if (!rb->kbd_input (cbuffer, sizeof (cbuffer), NULL)) { /* user didn't edit, no reason to write it back */ return true; diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c index 914761e73b..1689321abe 100644 --- a/apps/plugins/keybox.c +++ b/apps/plugins/keybox.c @@ -196,12 +196,12 @@ static void add_entry(int selected_item) rb->splash(HZ, "Enter title"); pw_list.entries[i].title[0] = '\0'; - if (rb->kbd_input(pw_list.entries[i].title, FIELD_LEN) < 0) + if (rb->kbd_input(pw_list.entries[i].title, FIELD_LEN, NULL) < 0) return; rb->splash(HZ, "Enter name"); pw_list.entries[i].name[0] = '\0'; - if (rb->kbd_input(pw_list.entries[i].name, FIELD_LEN) < 0) + if (rb->kbd_input(pw_list.entries[i].name, FIELD_LEN, NULL) < 0) { pw_list.entries[i].title[0] = '\0'; return; @@ -209,7 +209,7 @@ static void add_entry(int selected_item) rb->splash(HZ, "Enter password"); pw_list.entries[i].password[0] = '\0'; - if (rb->kbd_input(pw_list.entries[i].password, FIELD_LEN) < 0) + if (rb->kbd_input(pw_list.entries[i].password, FIELD_LEN, NULL) < 0) { pw_list.entries[i].title[0] = '\0'; pw_list.entries[i].name[0] = '\0'; @@ -244,7 +244,7 @@ static void edit_title(int selected_item) if (entry->next) entry = entry->next; } - if (rb->kbd_input(entry->title, FIELD_LEN) == 0) + if (rb->kbd_input(entry->title, FIELD_LEN, NULL) == 0) data_changed = true; } @@ -257,7 +257,7 @@ static void edit_name(int selected_item) if (entry->next) entry = entry->next; } - if (rb->kbd_input(entry->name, FIELD_LEN) == 0) + if (rb->kbd_input(entry->name, FIELD_LEN, NULL) == 0) data_changed = true; } @@ -270,7 +270,7 @@ static void edit_pw(int selected_item) if (entry->next) entry = entry->next; } - if (rb->kbd_input(entry->password, FIELD_LEN) == 0) + if (rb->kbd_input(entry->password, FIELD_LEN, NULL) == 0) data_changed = true; } @@ -513,11 +513,11 @@ static int enter_pw(char *pw_buf, size_t buflen, bool new_pw) if (new_pw) { rb->splash(HZ, "Enter new master password"); - if (rb->kbd_input(buf[0], sizeof(buf[0])) < 0) + if (rb->kbd_input(buf[0], sizeof(buf[0]), NULL) < 0) return -1; rb->splash(HZ, "Confirm master password"); - if (rb->kbd_input(buf[1], sizeof(buf[1])) < 0) + if (rb->kbd_input(buf[1], sizeof(buf[1]), NULL) < 0) return -1; if (rb->strcmp(buf[0], buf[1])) @@ -534,7 +534,7 @@ static int enter_pw(char *pw_buf, size_t buflen, bool new_pw) } rb->splash(HZ, "Enter master password"); - if (rb->kbd_input(pw_buf, buflen) < 0) + if (rb->kbd_input(pw_buf, buflen, NULL) < 0) return -1; hash_pw(&pwhash); return 0; diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index 9a7aef51d0..1149f35bac 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES @@ -69,6 +69,8 @@ bmp_smooth_scale.c pluginlib_albumart.c #endif +kbd_helper.c + #endif /* HAVE_LCD_BITMAP */ #ifdef HAVE_TOUCHSCREEN diff --git a/apps/plugins/lib/kbd_helper.c b/apps/plugins/lib/kbd_helper.c new file mode 100644 index 0000000000..00191c3532 --- /dev/null +++ b/apps/plugins/lib/kbd_helper.c @@ -0,0 +1,63 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2020 William Wilgus + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "plugin.h" +#include "kbd_helper.h" + +/* USAGE: + unsigned short kbd[64]; + unsigned short *kbd_p = kbd; + if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd))) + kbd_p = NULL; + + rb->kbd_input(buf,sizeof(buf), kbd_p); +*/ + +/* create a custom keyboard layout for kbd_input + * success returns size of buffer used + * failure returns 0 +*/ +int kbd_create_layout(char *layout, unsigned short *buf, int bufsz) +{ + unsigned short *pbuf; + const unsigned char *p = layout; + int len = 0; + pbuf = buf; + while (*p && (pbuf - buf + 8) < bufsz) + { + p = rb->utf8decode(p, &pbuf[len+1]); + if (pbuf[len+1] == '\n') + { + *pbuf = len; + pbuf += len+1; + len = 0; + } + else + len++; + } + + if (len+1 < bufsz) + { + *pbuf = len; + pbuf[len+1] = 0xFEFF; /* mark end of characters */ + return len + 1; + } + return 0; +} diff --git a/apps/plugins/lib/kbd_helper.h b/apps/plugins/lib/kbd_helper.h new file mode 100644 index 0000000000..90443cbf3f --- /dev/null +++ b/apps/plugins/lib/kbd_helper.h @@ -0,0 +1,27 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2020 William Wilgus + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef KBD_HELPER_H +#define KBD_HELPER_H + +/* create a custom keyboard layout for kbd_input */ +int kbd_create_layout(char *layout, unsigned short *buf, int bufsz); + +#endif /* KBD_HELPER_H */ diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c index c7f36968a1..4ae9722ae3 100644 --- a/apps/plugins/lrcplayer.c +++ b/apps/plugins/lrcplayer.c @@ -2475,7 +2475,7 @@ static bool lrc_lyrics_menu(void) #endif case LRC_MENU_LRC_DIR: rb->strcpy(temp_buf, prefs.lrc_directory); - if (!rb->kbd_input(temp_buf, sizeof(prefs.lrc_directory))) + if (!rb->kbd_input(temp_buf, sizeof(prefs.lrc_directory), NULL)) rb->strcpy(prefs.lrc_directory, temp_buf); break; case MENU_ATTACHED_USB: diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 6820c30dc3..a33fdf7170 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c @@ -152,7 +152,7 @@ RB_WRAP(kbd_input) else buffer[0] = '\0'; - if(!rb->kbd_input(buffer, LUAL_BUFFERSIZE)) + if(!rb->kbd_input(buffer, LUAL_BUFFERSIZE, NULL)) { luaL_addstring(&b, buffer); luaL_pushresult(&b); diff --git a/apps/plugins/otp.c b/apps/plugins/otp.c index 6dece4ad38..2da1ef83f5 100644 --- a/apps/plugins/otp.c +++ b/apps/plugins/otp.c @@ -411,10 +411,11 @@ static void add_acct_manual(void) memset(accounts + next_slot, 0, sizeof(struct account_t)); rb->splash(HZ * 1, "Enter account name."); - if(rb->kbd_input(accounts[next_slot].name, sizeof(accounts[next_slot].name)) < 0) + char* buf = accounts[next_slot].name; + if(rb->kbd_input(buf, sizeof(accounts[next_slot].name), NULL) < 0) return; - if(acct_exists(accounts[next_slot].name)) + if(acct_exists(buf)) { rb->splash(HZ * 2, "Duplicate account name!"); return; @@ -425,7 +426,7 @@ static void add_acct_manual(void) char temp_buf[SECRET_MAX * 2]; memset(temp_buf, 0, sizeof(temp_buf)); - if(rb->kbd_input(temp_buf, sizeof(temp_buf)) < 0) + if(rb->kbd_input(temp_buf, sizeof(temp_buf), NULL) < 0) return; if((accounts[next_slot].sec_len = base32_decode(accounts[next_slot].secret, SECRET_MAX, temp_buf)) <= 0) @@ -457,7 +458,7 @@ static void add_acct_manual(void) temp_buf[1] = '0'; } - if(rb->kbd_input(temp_buf, sizeof(temp_buf)) < 0) + if(rb->kbd_input(temp_buf, sizeof(temp_buf), NULL) < 0) return; if(!accounts[next_slot].is_totp) @@ -470,7 +471,7 @@ static void add_acct_manual(void) memset(temp_buf, 0, sizeof(temp_buf)); temp_buf[0] = '6'; - if(rb->kbd_input(temp_buf, sizeof(temp_buf)) < 0) + if(rb->kbd_input(temp_buf, sizeof(temp_buf), NULL) < 0) return; accounts[next_slot].digits = rb->atoi(temp_buf); @@ -667,7 +668,7 @@ static void edit_menu(int acct) case 0: // rename rb->splash(HZ, "Enter new name."); rb->strlcpy(data_buf, accounts[acct].name, sizeof(data_buf)); - if(rb->kbd_input(data_buf, sizeof(data_buf)) < 0) + if(rb->kbd_input(data_buf, sizeof(data_buf), NULL) < 0) break; if(acct_exists(data_buf)) { @@ -695,7 +696,7 @@ static void edit_menu(int acct) else rb->snprintf(data_buf, sizeof(data_buf), "%d", accounts[acct].totp_period); - if(rb->kbd_input(data_buf, sizeof(data_buf)) < 0) + if(rb->kbd_input(data_buf, sizeof(data_buf), NULL) < 0) break; if(accounts[acct].is_totp) @@ -709,7 +710,7 @@ static void edit_menu(int acct) break; case 3: // digits rb->snprintf(data_buf, sizeof(data_buf), "%d", accounts[acct].digits); - if(rb->kbd_input(data_buf, sizeof(data_buf)) < 0) + if(rb->kbd_input(data_buf, sizeof(data_buf), NULL) < 0) break; accounts[acct].digits = rb->atoi(data_buf); @@ -722,7 +723,7 @@ static void edit_menu(int acct) memcpy(temp_sec, accounts[acct].secret, accounts[acct].sec_len); base32_encode(accounts[acct].secret, accounts[acct].sec_len, data_buf, sizeof(data_buf)); - if(rb->kbd_input(data_buf, sizeof(data_buf)) < 0) + if(rb->kbd_input(data_buf, sizeof(data_buf), NULL) < 0) break; int ret = base32_decode(accounts[acct].secret, sizeof(accounts[acct].secret), data_buf); diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index 3bae2e1e64..daeca3ccd7 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c @@ -2411,7 +2411,7 @@ static bool do_configure_item(config_item *cfgs, int idx) } rb->strlcpy(newstr, cfg->u.string.sval, MAX_STRLEN); - if(rb->kbd_input(newstr, MAX_STRLEN) < 0) + if(rb->kbd_input(newstr, MAX_STRLEN, NULL) < 0) { sfree(newstr); return false; diff --git a/apps/plugins/resistor.c b/apps/plugins/resistor.c index 16374b3d18..ec6a364f23 100644 --- a/apps/plugins/resistor.c +++ b/apps/plugins/resistor.c @@ -623,7 +623,7 @@ static void led_resistance_calc(void) rb->splash(HZ*2, "(First) Input the supply voltage:"); memset(kbd_buffer,0,sizeof(kbd_buffer)); - rb->kbd_input(kbd_buffer, sizeof(kbd_buffer)); + rb->kbd_input(kbd_buffer, sizeof(kbd_buffer), NULL); input_voltage = rb->atoi(kbd_buffer); if(input_voltage == 0) break; @@ -660,7 +660,7 @@ static void led_resistance_calc(void) rb->lcd_clear_display(); rb->splash(HZ*2, "Input the foreward current, in mA"); memset(fwd_kbd_buffer,0,sizeof(fwd_kbd_buffer)); - rb->kbd_input(fwd_kbd_buffer, sizeof(fwd_kbd_buffer)); + rb->kbd_input(fwd_kbd_buffer, sizeof(fwd_kbd_buffer), NULL); foreward_current = ((rb->atoi(fwd_kbd_buffer))/10); break; } @@ -817,7 +817,7 @@ static void resistance_to_color(void) NULL, false); if(ret<0) break; - rb->kbd_input(kbd_buffer, sizeof(kbd_buffer)); + rb->kbd_input(kbd_buffer, sizeof(kbd_buffer), NULL); /* As stated above somewhere, we (I) need to make a calculator-like keypad, that keyboard isn't all that fun to use. */ ret = rb->do_menu(&r_to_c_menu_tol, &menu_selection_tol, diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index 3cd231c06c..caa8d499cb 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c @@ -276,7 +276,7 @@ static bool do_slot(int slot_id, bool is_load) { if (!is_load) { slot_info(desc_buf, sizeof(desc_buf), slot_id, false); - if ( rb->kbd_input(desc_buf, sizeof(desc_buf)) < 0 ) + if ( rb->kbd_input(desc_buf, sizeof(desc_buf), NULL) < 0 ) return false; if ( !strlen(desc_buf) ) strlcpy(desc_buf, "Untitled", sizeof(desc_buf)); diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c index 3759489fe1..35d2f21ba7 100644 --- a/apps/plugins/rockpaint.c +++ b/apps/plugins/rockpaint.c @@ -1794,7 +1794,7 @@ static void draw_text( int x, int y ) { case TEXT_MENU_TEXT: rb->lcd_set_foreground(COLOR_BLACK); - rb->kbd_input( buffer->text.text, MAX_TEXT ); + rb->kbd_input( buffer->text.text, MAX_TEXT, NULL ); break; case TEXT_MENU_FONT: @@ -2790,7 +2790,7 @@ static void goto_menu(void) rb->lcd_set_foreground(COLOR_BLACK); if (!filename[0]) rb->strcpy(filename,"/"); - if( !rb->kbd_input( filename, MAX_PATH ) ) + if( !rb->kbd_input( filename, MAX_PATH, NULL ) ) { if( !check_extention( filename, ".bmp" ) ) rb->strcat(filename, ".bmp"); diff --git a/apps/plugins/sdl/progs/duke3d/Game/src/console.c b/apps/plugins/sdl/progs/duke3d/Game/src/console.c index c4a465eda3..47135f85f1 100644 --- a/apps/plugins/sdl/progs/duke3d/Game/src/console.c +++ b/apps/plugins/sdl/progs/duke3d/Game/src/console.c @@ -224,7 +224,7 @@ void CONSOLE_HandleInput() //If console_buffer[0] strlen() != 0 //1. Push the dirty_buffer unto the console_buffer //2. parse the text - rb->kbd_input(dirty_buffer, sizeof(dirty_buffer)); + rb->kbd_input(dirty_buffer, sizeof(dirty_buffer), NULL); CONSOLE_Printf("%s", dirty_buffer); console_cursor_pos = 0; diff --git a/apps/plugins/sdl/progs/quake/keys.c b/apps/plugins/sdl/progs/quake/keys.c index 896bbaa795..e1285080a8 100644 --- a/apps/plugins/sdl/progs/quake/keys.c +++ b/apps/plugins/sdl/progs/quake/keys.c @@ -151,7 +151,7 @@ keyname_t keynames[] = /* Rockbox hack */ void rb_console(void) { - rb->kbd_input(key_lines[edit_line] + 1, MAXCMDLINE-1); + rb->kbd_input(key_lines[edit_line] + 1, MAXCMDLINE-1, NULL); } /* diff --git a/apps/plugins/search.c b/apps/plugins/search.c index 831fe70cd4..ff7be343f6 100644 --- a/apps/plugins/search.c +++ b/apps/plugins/search.c @@ -111,7 +111,7 @@ static void clear_display(void){ static bool search_init(const char* file){ rb->memset(search_string, 0, sizeof(search_string)); - if (!rb->kbd_input(search_string,sizeof search_string)){ + if (!rb->kbd_input(search_string,sizeof(search_string), NULL)){ clear_display(); rb->splash(0, "Searching..."); fd = rb->open_utf8(file, O_RDONLY); diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index e4c34930b1..62812e0237 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -1963,7 +1963,7 @@ static bool sokoban_loop(void) *loc = '.'; } - if (!rb->kbd_input(buf, MAX_PATH)) + if (!rb->kbd_input(buf, MAX_PATH, NULL)) save(buf, true); } else rb->splash(HZ*2, "Solution too long to save"); diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c index 1fd59727fc..539fc85011 100644 --- a/apps/plugins/splitedit.c +++ b/apps/plugins/splitedit.c @@ -874,7 +874,7 @@ static void save_editor(struct mp3entry *mp3, int splittime) break; case SE_PART1_NAME: - rb->kbd_input(part1_name, MAX_PATH); + rb->kbd_input(part1_name, MAX_PATH, NULL); break; case SE_PART2_SAVE: @@ -882,7 +882,7 @@ static void save_editor(struct mp3entry *mp3, int splittime) break; case SE_PART2_NAME: - rb->kbd_input(part2_name, MAX_PATH); + rb->kbd_input(part2_name, MAX_PATH, NULL); break; case SE_SAVE: diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c index 12880bd97b..34a1f6dd07 100644 --- a/apps/plugins/sudoku/sudoku.c +++ b/apps/plugins/sudoku/sudoku.c @@ -983,7 +983,7 @@ static int sudoku_edit_menu(struct sudoku_state_t* state) switch (result) { case 0: /* Save new game */ - rb->kbd_input(state->filename,MAX_PATH); + rb->kbd_input(state->filename,MAX_PATH, NULL); if (save_sudoku(state)) { state->editmode=0; } else { diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c index fde11552ca..50027a30c6 100644 --- a/apps/plugins/superdom.c +++ b/apps/plugins/superdom.c @@ -689,7 +689,7 @@ static int save_game(void) char savepath[MAX_PATH]; rb->snprintf(savepath, sizeof(savepath), "/Savegame.ssg"); - if(rb->kbd_input(savepath, MAX_PATH)) + if(rb->kbd_input(savepath, MAX_PATH, NULL)) { DEBUGF("Keyboard input failed\n"); return -1; diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c index 0eb1bb1dcc..0cbb61c774 100644 --- a/apps/plugins/text_editor.c +++ b/apps/plugins/text_editor.c @@ -173,7 +173,7 @@ static bool save_changes(int overwrite) if (newfile || !overwrite) { - if(rb->kbd_input(filename,MAX_PATH) < 0) + if(rb->kbd_input(filename,MAX_PATH, NULL) < 0) { newfile = true; return false; @@ -247,7 +247,7 @@ static int do_item_menu(int cur_sel) ret = MENU_RET_NO_UPDATE; break; case 2: /* insert above */ - if (!rb->kbd_input(copy_buffer,MAX_LINE_LEN)) + if (!rb->kbd_input(copy_buffer,MAX_LINE_LEN, NULL)) { do_action(ACTION_INSERT,copy_buffer,cur_sel); copy_buffer[0]='\0'; @@ -255,7 +255,7 @@ static int do_item_menu(int cur_sel) } break; case 3: /* insert below */ - if (!rb->kbd_input(copy_buffer,MAX_LINE_LEN)) + if (!rb->kbd_input(copy_buffer,MAX_LINE_LEN, NULL)) { do_action(ACTION_INSERT,copy_buffer,cur_sel+1); copy_buffer[0]='\0'; @@ -425,7 +425,7 @@ enum plugin_status plugin_start(const void* parameter) switch (rb->do_menu(&menu, NULL, NULL, false)) { case 0: - temp_changed = !rb->kbd_input(extension, sizeof(extension)); + temp_changed = !rb->kbd_input(extension, sizeof(extension), NULL); break; case 1: old_color = color; @@ -446,7 +446,7 @@ enum plugin_status plugin_start(const void* parameter) } else #endif - if (!rb->kbd_input(temp_line,MAX_LINE_LEN)) + if (!rb->kbd_input(temp_line,MAX_LINE_LEN, NULL)) { if (line_count) do_action(ACTION_UPDATE,temp_line,cur_sel); diff --git a/apps/plugins/zxbox/snapshot.c b/apps/plugins/zxbox/snapshot.c index 74845bac8e..6d0797bf1e 100644 --- a/apps/plugins/zxbox/snapshot.c +++ b/apps/plugins/zxbox/snapshot.c @@ -628,7 +628,7 @@ void save_snapshot(void) name[0]='/'; name[1]='\0'; put_msg("Enter name of snapshot file to save:"); - if (!rb->kbd_input((char*)&name, sizeof name)) + if (!rb->kbd_input((char*)&name, sizeof(name), NULL)) save_snapshot_file(&name[0]); } |