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()
{
showCursorPos(Mouse.
status());
}
void loop()
{
if (status.buttons.left) {
Canvas.
moveTo(status.X, status.Y);
}
if (status.buttons.right) {
}
if (status.buttons.middle) {
}
if (status.wheelDelta != 0) {
indicatorY = fabgl::tclamp(indicatorY + status.wheelDelta, 0, Canvas.
getHeight() - 16);
}
showCursorPos(status);
}