input: fix keyboard to joystick mapping.

This commit is contained in:
Sorgelig
2021-11-26 22:48:07 +08:00
parent 4cee9159d0
commit d02099847b

View File

@@ -2685,7 +2685,7 @@ static void input_cb(struct input_event *ev, struct input_absinfo *absinfo, int
{
for (uint i = 0; i < BTN_NUM; i++)
{
if (ev->code == input[dev].map[i])
if (ev->code == (uint16_t)input[dev].map[i])
{
if (i <= 3 && origcode == ev->code) origcode = 0; // prevent autofire for original dpad
if (ev->value <= 1) joy_digital((user_io_get_kbdemu() == EMU_JOY0) ? 1 : 2, 1 << i, origcode, ev->value, i);