Miscellany
public text v1 · immutablestatic int touchpad_buttons[3][3] = {
{BUTTON_TOPLEFT, BUTTON_TOPMIDDLE, BUTTON_TOPRIGHT},
{BUTTON_MIDLEFT, BUTTON_CENTER, BUTTON_MIDRIGHT},
{BUTTON_BOTTOMLEFT, BUTTON_BOTTOMMIDDLE, BUTTON_BOTTOMRIGHT},
};
....
y is current y pixel, x is x pixel
r_button |= touchpad_buttons[y/(LCD_HEIGHT/3)][x/(LCD_WIDTH/3)];