PS/2 mouse and mouse pointer on screen
int indicatorX = 300;
int indicatorY = 170;
int cursor = 0;
void showCursorPos(MouseStatus const & status)
{
canvas.drawTextFmt(indicatorX, indicatorY, " %d %d ", status.X, status.Y);
}
void setup()
{
DisplayController.begin();
canvas.clear();
canvas.selectFont(&fabgl::FONT_8x8);
}
void loop()
{
if (status.buttons.left) {
canvas.setPixel(status.X, status.Y);
canvas.moveTo(status.X, status.Y);
}
if (status.buttons.right) {
}
if (status.buttons.middle) {
canvas.clear();
}
if (status.wheelDelta != 0) {
indicatorY = fabgl::tclamp(indicatorY + status.wheelDelta, 0, canvas.getHeight() - 16);
canvas.clear();
}
showCursorPos(status);
}