evdev: revert facepalm change

This commit is contained in:
Megamouse 2020-05-01 10:01:42 +02:00
parent 7df8258551
commit 2de6a9bc44

View file

@ -912,12 +912,15 @@ bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std
return static_cast<u32>(key);
};
auto evdevbutton = [&, idx = i](const cfg::string& name)
auto evdevbutton = [&](const cfg::string& name)
{
// This function calls find_key, which also determines last_type and axis_orientations[i].
// i is incremented at the end of find_key, so we need to back it up.
const int current_index = i;
EvdevButton button;
button.code = find_key(name);
button.type = last_type;
button.dir = axis_orientations[idx];
button.dir = axis_orientations[current_index];
return button;
};