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);
}
void setMouseCursor(Cursor *cursor)
Sets mouse cursor and make it visible.
A class with a set of drawing methods.
MouseStatus & status()
Gets or sets current mouse status.
void setupAbsolutePositioner(int width, int height, bool createAbsolutePositionsQueue, BitmappedDisplayController *updateDisplayController=nullptr, uiApp *app=nullptr)
Initializes absolute position handler.
MouseStatus getNextStatus(int timeOutMS=-1)
Gets the next status from the status queue.
static Mouse * mouse()
Returns the instance of Mouse object automatically created by PS2Controller.
static void begin(gpio_num_t port0_clkGPIO, gpio_num_t port0_datGPIO, gpio_num_t port1_clkGPIO=GPIO_UNUSED, gpio_num_t port1_datGPIO=GPIO_UNUSED)
Initializes PS2 device controller.
The PS2 device controller class.
Represents the VGA bitmapped controller.
GlyphOptions & FillBackground(bool value)
Helper method to set or reset fillBackground.
This file is the all in one include file. Application can just include this file to use FabGL library...
#define VGA_640x350_70HzAlt1
CursorName
This enum defines a set of predefined mouse cursors.