1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
William Wilgus 2020-07-21 02:33:53 -04:00
parent a5df94beb5
commit cb94b3ae2e
37 changed files with 173 additions and 69 deletions

View file

@ -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));