The logic in indev_button_proc() has a flaw in that it assumes a button will always be pressed for at least two calls to read the button state.
(For an actual physical button, this is a reasonable assumption, but for things like faking a button press in development until the actual hardware is available, it will not necessarily be true.)
/*Still the same point is pressed*/
if(i->proc.types.pointer.last_point.x == i->proc.types.pointer.act_point.x &&
i->proc.types.pointer.last_point.y == i->proc.types.pointer.act_point.y && data->state == LV_INDEV_STATE_PR) {
indev_proc_press(&i->proc);
}
else {
/*If a new point comes always make a release*/
indev_proc_release(&i->proc);
}
The press is processed only after it is not considered a new point, so if the next time the button callback is sampled it must still be “down” to register.
Adding the following code after the call to indev_proc_release() appears to fix it. (I have not made an effort to optimize the code with this new logic, this was just a quick test.)
Great, thank you! I’ve tried the master branch and it works perfectly!
I know this was an edge case (using a character received from a serial port to set a one-sample “key down” state to simulate the future physical button), so I appreciate you fixing it!