OSD: support increase/decrease options where possible.

This commit is contained in:
sorgelig
2020-06-21 06:16:12 +08:00
parent d70dc9de5d
commit e426de98f4
2 changed files with 245 additions and 116 deletions

View File

@@ -1585,6 +1585,14 @@ static void joy_digital(int jnum, uint32_t mask, uint32_t code, char press, int
ev.code = KEY_BACKSPACE;
break;
case JOY_L:
ev.code = KEY_MINUS;
break;
case JOY_R:
ev.code = KEY_EQUAL;
break;
default:
ev.code = (bnum == BTN_OSD) ? KEY_MENU : 0;
}
@@ -2160,6 +2168,18 @@ static void input_cb(struct input_event *ev, struct input_absinfo *absinfo, int
return;
}
if (ev->code == input[dev].mmap[SYS_BTN_L])
{
joy_digital(0, JOY_L, 0, ev->value, 0);
return;
}
if (ev->code == input[dev].mmap[SYS_BTN_R])
{
joy_digital(0, JOY_R, 0, ev->value, 0);
return;
}
if (ev->code == input[dev].mmap[SYS_BTN_SELECT])
{
struct input_event key_ev = *ev;